src.dackar.pipelines.LocationEntity

Attributes

logger

Classes

LocationEntity

How to use it:

Functions

create_location_component(nlp, name, patterns)

Module Contents

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

Bases: object

How to use it:

from LocationEntity import LocationEntity
nlp = spacy.load("en_core_web_sm")
patterns = {'label': 'location', 'pattern': [{'LOWER': 'follow'}], 'id': 'location'}
cmatcher = ConjectureEntity(nlp, patterns)
doc = nlp("It is close to 5pm.")
updatedDoc = cmatcher(doc)

or:

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

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