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