Error al utilizar Stanford POS Tagger en NLTK Python
Estoy tratando de usar Stanford POS Tagger en NLTK pero no puedo ejecutar el código de ejemplo aquíhttp://www.nltk.org/api/nltk.tag.html#module-nltk.tag.stanford
import nltk
from nltk.tag.stanford import POSTagger
st = POSTagger(r'english-bidirectional-distim.tagger',r'D:/stanford-postagger/stanford-postagger.jar')
st.tag('What is the airspeed of an unladen swallow?'.split())
Ya he agregado variables de entorno como
CLASSPATH = D:/stanford-postagger/stanford-postagger.jar
STANFORD_MODELS = D:/stanford-postagger/models/
Aquí está el error que sigo recibiendo
Rastreo (llamadas recientes más última):
File "D:\pos_stanford.py", line 4, in <module>
st = POSTagger(r'english-bidirectional-distim.tagger',
r'D:/stanford-postagger/stanford-postagger.jar')
... LookupError: NLTK was unable to find the english-bidirectional-distim.tagger file! Use software specific configuration paramaters or set the STANFORD_MODELS environment variable.
Algunos foros sugieren que
File "C:\Python27\lib\site-packages\nltk\tag\stanford.py", line 45, in __init__
env_vars=('STANFORD_MODELS'), verbose=verbose)
debe cambiarse para que haya una coma en
env_vars=('STANFORD_MODELS',), verbose=verbose)
pero tampoco resuelve el problema. Por favor, ayúdame a resolver este problema.
Otra información: Estoy usando Windows 7 64 bit Python 2.7 32 bit NLTK 2.0