0

I have been through all the posts on Hunpos Tagger here and have followed them by the word to make it work, but unfortunately, each word is getting POS tagged as 'None'. Here is my code and output:

from nltk.tag.hunpos import HunposTagger
from nltk import word_tokenize

sentence = "Please turn off the computer and unplug the AC adaptor"
tokens = word_tokenize(sentence)
tagger = HunposTagger('/home/arindam/EclipseWorkspace/Resources/HunPOSTagger/Models/en_wsj.model', '/home/arindam/EclipseWorkspace/Resources/HunPOSTagger/hunpos-1.0-linux/hunpos-tag')
print tagger.tag(tokens)

[('Please', None), ('turn', None), ('off', None), ('the', None), ('computer', None), ('and', None), ('unplug', None), ('the', None), ('AC', None), ('adaptor', None)]

Can anyone help and let me know why this is happening?

alvas
  • 115,346
  • 109
  • 446
  • 738
damC
  • 1
  • Did you follow instructions on http://stackoverflow.com/a/30823202/610569 ? From your example sentence and following the instructions, I'm getting `[('Please', 'VB'), ('turn', 'VB'), ('off', 'RP'), ('the', 'DT'), ('computer', 'NN'), ('and', 'CC'), ('unplug', 'VB'), ('the', 'DT'), ('AC', 'NNP'), ('adaptor', 'NN')]`. – alvas Jul 22 '16 at 09:41
  • I suspect HunPOS can't find the model. Try moving the `en_wsj.model` to `/home/arindam/EclipseWorkspace/Resources/HunPOSTagger/ ` instead of `/home/arindam/EclipseWorkspace/Resources/HunPOSTagger/Models`. – alvas Jul 22 '16 at 09:42

0 Answers0