src.dackar.pipelines.TemporalRelationEntity

Attributes

logger

Classes

TemporalRelationEntity

How to use it:

Functions

create_temporal_relation_component(nlp, name, patterns)

Module Contents

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

Bases: object

How to use it:

from TemporalRelationEntity import TemporalRelationEntity
nlp = spacy.load("en_core_web_sm")
patterns = {'label': 'temporal_relation', 'pattern': [{'LOWER': 'follow'}], 'id': 'temporal_relation'}
cmatcher = ConjectureEntity(nlp, patterns)
doc = nlp("The system failed following the pump failure.")
updatedDoc = cmatcher(doc)

or:

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

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