In [1]: import spacy.en In [2]: parser = spacy.en.English() In [12]: ParsedSentence = parser(u"alphabet is a new startup specializing in eating their own words on leaving china to fight for information freedom") In [13]: print ParsedSentence.ents () In [14]: ParsedSentence = parser(u"Alphabet is a new startup specializing in eating their own words on leaving China to fight for information freedom") In [15]: print ParsedSentence.ents (Alphabet, China) In [16]: for Entity in ParsedSentence.ents: ....: print Entity.label, Entity.label_, ' '.join(t.orth_ for t in Entity) ....: 349 ORG Alphabet 350 GPE China
I used only default settings. Apparently, the NER of SpaCy is very sensitive to case of words.
1 comment:
Really good example.
Thanks.......
Post a Comment