I am trying to use the NLTK interface for Stanford NER in a python environment, nltk.tag.stanford.NERTagger .
from nltk.tag.stanford import NERTagger st = NERTagger('/usr/share/stanford-ner/classifiers/all.3class.distsim.crf.ser.gz', '/usr/share/stanford-ner/stanford-ner.jar') st.tag('Rami Eid is studying at Stony Brook University in NY'.split())
I should get the result:
[('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'), ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'LOCATION')]
I installed NLTK in accordance with the procedure described on the website
python nlp nltk stanford-nlp
Hans
source share