src.dackar.pipelines.GeneralEntity¶
Attributes¶
Classes¶
How to use it: |
Functions¶
|
Module Contents¶
- class src.dackar.pipelines.GeneralEntity.GeneralEntity(nlp, patterns, asSpan=True, callback=None)[source]¶
Bases:
object
How to use it:
from GeneralEntity import GeneralEntity nlp = spacy.load("en_core_web_sm") patterns = {'label': 'general', 'pattern': [{'LOWER': 'possible'}], 'id': 'general'} cmatcher = generalEntity(nlp, patterns) doc = nlp("Vibration seems like it is coming from the shaft.") updatedDoc = cmatcher(doc)
or:
nlp.add_pipe('general_entity', config={"patterns": {'label': 'general', 'pattern': [{'LOWER': 'possible'}], 'id': 'general'}, "asSpan":True}) newDoc = nlp(doc.text)