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: crate_anon.common.extendedconfigparser.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: crate_anon.common.extendedconfigparser.ExtendedConfigParser, cfg_output_name: str, schema_required: bool = True) None[source]

Read config from a configparser section.

Parameters
property dest_tablename: str

Returns the name of the destination table.

property destfields: List[str]

Returns the list of destination fields.

get_columns(engine: sqlalchemy.engine.base.Engine) List[sqlalchemy.sql.schema.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[sqlalchemy.sql.schema.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

property renames: Dict[str, str]

a dictionary mapping GATE annotation names to fieldnames in the NLP destination table.

See

Type

Return the “rename dictionary”