Created
August 30, 2017 15:50
-
-
Save julien-c/56c79cdcca6b7730b66d2462b0afcb64 to your computer and use it in GitHub Desktop.
Spacy NER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
nlp = spacy.load('en') | |
doc = nlp(text) | |
# At this point entity annotations are in `doc.ents` | |
for token in doc: | |
print tok.ent_iob_ + '-' + mapping[tok.ent_type_] # `I-PER`, etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment