src.dackar.pipelines.ConjectureEntity

Attributes

logger

Classes

ConjectureEntity

How to use it:

Functions

create_conjecture_component(nlp, name, patterns)

Module Contents

src.dackar.pipelines.ConjectureEntity.logger[source]
src.dackar.pipelines.ConjectureEntity.create_conjecture_component(nlp, name, patterns)[source]
class src.dackar.pipelines.ConjectureEntity.ConjectureEntity(nlp, patterns=None, callback=None)[source]

Bases: object

How to use it:

from ConjectureEntity import ConjectureEntity
nlp = spacy.load("en_core_web_sm")
patterns = {'label': 'conjecture', 'pattern': [{'LOWER': 'possible'}], 'id': 'conjecture'}
cmatcher = ConjectureEntity(nlp, patterns)
doc = nlp("Vibration seems like it is coming from the shaft.")
updatedDoc = cmatcher(doc)

or:

nlp.add_pipe('conjecture_entity', config={"patterns": {'label': 'conjecture', 'pattern': [{'LOWER': 'possible'}], 'id': 'conjecture'}})
newDoc = nlp(doc.text)
name = 'conjecture_entity'[source]
entityRuler[source]
__call__(doc)[source]
Parameters:

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