src.dackar.pipelines.TemporalAttributeEntity¶
Attributes¶
Classes¶
How to use it: |
Functions¶
|
Module Contents¶
- src.dackar.pipelines.TemporalAttributeEntity.create_temporal_attribute_component(nlp, name, patterns)[source]¶
- class src.dackar.pipelines.TemporalAttributeEntity.TemporalAttributeEntity(nlp, patterns=None, callback=None)[source]¶
Bases:
object
How to use it:
from TemporalAttributeEntity import TemporalAttributeEntity nlp = spacy.load("en_core_web_sm") patterns = {'label': 'temporal_attribute', 'pattern': [{'LOWER': 'about'}], 'id': 'temporal_attribute'} cmatcher = ConjectureEntity(nlp, patterns) doc = nlp("It is close to 5pm.") updatedDoc = cmatcher(doc)
or:
nlp.add_pipe('temporal_attribute_entity', config={"patterns": {'label': 'temporal_attribute_entity', 'pattern': [{'LOWER': 'about'}], 'id': 'temporal_attribute_entity'}}) newDoc = nlp(doc.text)