Hi!
I have just installed both NLTK and the Stanford POS Tagger on Windows 7 Ultimate. I have set
CLASSPATH to include: C:\stanford-postagger-full-2012-07-09\stanford-postagger.jar
STANFORD_MODELS: C:\stanford-postagger-full-2012-07-09\models\
But when I try to use nltk.tag.stanford.StanfordTagger I get errors about unset environment variables. (See below)
Does anyone know what I've done wrong, or how to fix this?
Thank you very much,
Dougal Graham
ERRORS:
If I don't set the jar file location:
Traceback (most recent call last):
File "tagging.py", line 3, in <module>
tg = nltk.tag.stanford.StanfordTagger('bidirectional-distsim-wsj-0-18.tagger')
File "C:\Python27\lib\site-packages\nltk\tag\stanford.py", line 42, in __init__
verbose=verbose)
File "C:\Python27\lib\site-packages\nltk\internals.py", line 597, in find_jar
raise LookupError('\n\n%s\n%s\n%s' % (div, msg, div))
LookupError:
===========================================================================
NLTK was unable to find ! Set the CLASSPATH environment variable.
If I explicitly set the jar file location:
Traceback (most recent call last):
File "tagging.py", line 3, in <module>
tg = nltk.tag.StanfordTagger('bidirectional-distsim-wsj-0-18.tagger', 'C:\\stanford-postagger-full-2012-07-09\\stanford-postagger.jar')
File "C:\Python27\lib\site-packages\nltk\tag\stanford.py", line 45, in __init__
env_vars=('STANFORD_MODELS'), verbose=verbose)
File "C:\Python27\lib\site-packages\nltk\internals.py", line 512, in find_file
raise LookupError('\n\n%s\n%s\n%s' % (div, msg, div))
LookupError:
===========================================================================
NLTK was unable to find the bidirectional-distsim-wsj-0-18.tagger file!
Use software specific configuration paramaters or set the STANFORD_MODELS enviro
nment variable.
===========================================================================