Skip to content

edsnlp.connectors.brat

BratConnector

Bases: object

Deprecated. Use edsnlp.data.read_standoff and edsnlp.data.write_standoff instead. Two-way connector with BRAT. Supports entities only.

Parameters

PARAMETER DESCRIPTION
directory

Directory containing the BRAT files.

TYPE: Union[str, Path]

n_jobs

Number of jobs for multiprocessing, by default 1

TYPE: int DEFAULT: 1

attributes

Mapping from BRAT attributes to spaCy Span extensions. Extensions / attributes that are not in the mapping are not imported or exported If left to None, the mapping is filled with all BRAT attributes.

TYPE: Optional[AttributesMappingArg] DEFAULT: None

span_groups

Additional span groups to look for entities in spaCy documents when exporting. Missing label (resp. span group) names are not imported (resp. exported) If left to None, the sequence is filled with all BRAT entity labels.

TYPE: SpanSetterArg DEFAULT: ['ents', '*']

docs2brat

Writes a list of spaCy documents to file.