spacy_detector#

scikitplot.cleanprompt.spacy_detector(model=None, labels=frozenset({'EVENT', 'FAC', 'GPE', 'LANGUAGE', 'LAW', 'LOC', 'NORP', 'ORG', 'PERSON', 'PRODUCT', 'WORK_OF_ART'}), language='en', size='sm', **kwargs)[source]#

Build a NerDetector.

Parameters:
modelstr, default=’en_core_web_lg’

Name of an installed spaCy model.

labelsiterable of str, optional

Entity labels to redact.

**kwargs

Forwarded to NerDetector.

Returns:
NerDetector

The detector. Construction does not import spaCy or load the model; both happen on the first NerDetector.detect call.

Parameters:
Return type:

NerDetector

Examples

>>> detector = spacy_detector()
>>> detector.name
'ner:en_core_web_lg'