Introduction to Natural Language Processing in Python
Katharine Jarmul
Founder, kjamistan
gensim
, with different implementations(source: https://demos.explosion.ai/displacy-ent/)
import spacy
nlp = spacy.load('en_core_web_sm')
nlp.entity
<spacy.pipeline.EntityRecognizer at 0x7f76b75e68b8>
doc = nlp("""Berlin is the capital of Germany; and the residence of Chancellor Angela Merkel.""")
doc.ents
(Berlin, Germany, Angela Merkel)
print(doc.ents[0], doc.ents[0].label_)
Berlin GPE
nltk
Introduction to Natural Language Processing in Python