14.5.21. crate_anon.nlp_manager.output_user_config
crate_anon/nlp_manager/output_user_config.py
Copyright (C) 2015, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CRATE. If not, see <https://www.gnu.org/licenses/>.
Define output configuration for GATE NLP applications.
- class crate_anon.nlp_manager.output_user_config.OutputUserConfig(parser: ExtendedConfigParser, cfg_output_name: str, schema_required: bool = True)[source]
Class defining configuration for the output of a given GATE app.
See the documentation for the NLP config file.
- __init__(parser: ExtendedConfigParser, cfg_output_name: str, schema_required: bool = True) None [source]
Read config from a configparser section.
- Parameters:
parser –
crate_anon.common.extendedconfigparser.ExtendedConfigParser
cfg_output_name –
- config file section name suffix – this is the second of the
pair of strings in the
outputtypemap
part of the GATE NLP app config section. See- schema_required:
is it required that the user has specified a schema, i.e. destfields and a desttable? - Should be true for Gate, False for Cloud as the remote processors may have their own schema definition.
- property dest_tablename: str
Returns the name of the destination table.
- property destfields: List[str]
Returns the list of destination fields.
- get_columns(engine: Engine) List[Column] [source]
Return all SQLAlchemy
Column
definitions for the destination table.- Parameters:
engine – SQLAlchemy database
Engine
- Returns:
list of SQLAlchemy
Column
objects
- property indexes: List[Index]
Return all SQLAlchemy
Index
definitions for the destination table.- Returns:
list of SQLAlchemy
Index
objects
- property null_literals: List[str]
Returns string values from the GATE output that will be interpreted as NULL values.
See
null_literals
in the NLP config file.
- property renames: Dict[str, str]
a dictionary mapping GATE annotation names to fieldnames in the NLP destination table.
See
renames
in the NLP config file.
- Type:
Return the “rename dictionary”