src.dackar.pipelines.GeneralEntity

Attributes

logger

Classes

GeneralEntity

How to use it:

Functions

create_general_component(nlp, name, patterns, asSpan)

Module Contents

src.dackar.pipelines.GeneralEntity.logger[source]
src.dackar.pipelines.GeneralEntity.create_general_component(nlp, name, patterns, asSpan)[source]
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)
name = 'general_entity'[source]
entityRuler[source]
asSpan[source]
__call__(doc)[source]
Parameters:

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