src.dackar.pipelines.SimpleEntityMatcher

Attributes

logger

Classes

SimpleEntityMatcher

How to use it:

Functions

create_simple_matcher_component(nlp, name, label, ...)

Module Contents

src.dackar.pipelines.SimpleEntityMatcher.logger[source]
src.dackar.pipelines.SimpleEntityMatcher.create_simple_matcher_component(nlp, name, label, terms, asSpan)[source]
class src.dackar.pipelines.SimpleEntityMatcher.SimpleEntityMatcher(nlp, label, terms, asSpan=True, callback=None)[source]

Bases: object

How to use it:

from SimpleEntityMatcher import SimpleEntityMatcher
nlp = spacy.load("en_core_web_sm")
terms = [{"LOWER": "hello"}, {"IS_PUNCT": True}, {"LOWER": "world"}]
pmatcher = SimpleEntityMatcher(nlp, 'ssc', terms)
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('simple_entity_matcher', config={"label": "ssc", "terms":[{"LOWER": "hello"}, {"IS_PUNCT": True}, {"LOWER": "world"}], "asSpan":True})
newDoc = nlp(doc.text)
name = 'simple_entity_matcher'[source]
matcher[source]
asSpan[source]
__call__(doc)[source]
Parameters:

doc – spacy.tokens.doc.Doc, the processed document using nlp pipelines