Skip to content

Spacy Mentions Extractor

Bases: MentionsExtractor

SpaCy mentions extractor

Parameters:

Name Type Description Default
extractor_type Optional[ExtractorType]

Type of extractor to get mentions. One of: - NER: to use Named Entity Recognition model to get the mentions - POS: to get the mentions based on the linguistics

NER

require_existing_ner: bool property

If the type of the extractor is NER the existing NER is required

predict(docs, batch_size=None)

Predict mentions of docs

Parameters:

Name Type Description Default
docs Iterator[Doc]

Documents to get mentions of

required
batch_size

Batch size to use

None

Returns:

Type Description

Spans of the mentions

predict_ner_mentions(docs, batch_size=None)

Predict mentions of docs using NER model

Parameters:

Name Type Description Default
docs Iterator[Doc]

Documents to get mentions of

required
batch_size Optional[int]

Batch size to use

None

Returns:

Type Description

Spans of the mentions

predict_pos_mentions(docs, batch_size=None)

Predict mentions of docs using POS linguistics

Parameters:

Name Type Description Default
docs Iterator[Doc]

Documents to get mentions of

required
batch_size Optional[int]

Batch size to use

None

Returns:

Type Description

Spans of the mentions