spaCy v2.0 extension and pipeline component for adding Named Entities metadata to
Doc objects. Detects Named Entities using dictionaries. The extension sets the custom
._.entities. Named Entities are matched using the python module
flashtext, and looked up in the data provided by different dictionaries.
import spacy from spacy_lookup import Entity nlp = spacy.load('en') entity = Entity(keywords_list=['python', 'java platform']) nlp.add_pipe(entity, last=True) doc = nlp(u"I am a product manager for a java and python.") assert doc._.has_entities == True assert doc[2:5]._.has_entities == True assert doc._.is_entity == False assert doc._.is_entity == True print(doc._.entities)
Submit your project
If you have a project that you want the spaCy community to make use of, you can suggest it by submitting a pull request to the spaCy website repository. The Universe database is open-source and collected in a simple JSON file. For more details on the formats and available fields, see the documentation. Looking for inspiration your own spaCy plugin or extension? Check out the
project idea label on the issue tracker.