2

I am trying to get the named entities in a small test using stanford NER tagger. Here is the code:

from nltk.tag import StanfordNERTagger
st = StanfordNERTagger('english.all.3class.distsim.crf.ser')
print st.tag('Ram offers computer science course'.split())

Output I get is:

[(u'Ram', u'O'), (u'offers', u'O'), (u'computer', u'O'), (u'science', u'O'), (u'course', u'O')]

I am not getting why all the tags are 'O'. While Ram is a person, Computer is an object,science and course are also classifiable objects.

Is there any way I can get named entities for my sentence Like below:

Ram -> Person
Coputer Science -> Course
1

Well,

no tool is perfect. It seems, that Stanford NER with the default model (no specific training) does not recognise Ram as a personal name and that is is also agnostic about course titles.

You may train it (or just add Ram to its dictionary) to get Ram right. I am not sure whether you can add categories of named entities like courses and how much effort this will take.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.