src.dackar.pipelines.TemporalAttributeEntity

Attributes

logger

Classes

TemporalAttributeEntity

How to use it:

Functions

create_temporal_attribute_component(nlp, name, patterns)

Module Contents

src.dackar.pipelines.TemporalAttributeEntity.logger[source]
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)
name = 'temporal_attribute_entity'[source]
entityRuler[source]
__call__(doc)[source]
Parameters:

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