src.dackar.pipelines.TemporalRelationEntity¶
Attributes¶
Classes¶
How to use it: |
Functions¶
|
Module Contents¶
- 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)