src.dackar.pipelines.PhraseEntityMatcher¶
Attributes¶
Classes¶
How to use it: |
Functions¶
|
Module Contents¶
- src.dackar.pipelines.PhraseEntityMatcher.create_phrase_matcher_component(nlp, name, label, terms, asSpan)[source]¶
- class src.dackar.pipelines.PhraseEntityMatcher.PhraseEntityMatcher(nlp, label, terms, asSpan=True, callback=None)[source]¶
Bases:
object
How to use it:
from PhraseEntityMatcher import PhraseEntityMatcher nlp = spacy.load("en_core_web_sm") phraseList = ["safety cage", "cage", "pump"] pmatcher = PhraseEntityMatcher(nlp, 'ssc', phraseList) doc = nlp("The shaft deflection is causing the safety cage to rattle. Pumps not experiencing enough flow for the pumps to keep the check valves open during test. Pump not experiencing enough flow during test. Shaft made noise. Vibration seems like it is coming from the shaft.") updatedDoc = pmatcher(doc)
or:
nlp.add_pipe('phrase_entity_matcher', config={"label": "ssc", "terms":["safety cage", "pump"], "asSpan":True}) newDoc = nlp(doc.text)