Typhon0 Typhon0 - 1 year ago 57
Python Question

tag word with NLTK stanford NER

I would like tag only a word and not a sentence with NLTK standford NER.

With

stNER.tag(word)
I have this output:

[[('o', 'O')], [('u', 'O')], [('r', 'O')]]


and I want
[('Our','O')]
.

Answer Source

I believe problem is that you provide word as a string object not list. Probably you should pass it like stNER.tag([word]).

But it's only guess you should provide bigger context (imports, type of variable word)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download