【发布时间】:2014-01-03 07:30:02
【问题描述】:
我正在尝试使用Hunpos tagger 进行 NLTK 的 POS 标记,而不是传统的 pos_tag(),但我在加载二进制文件 english.model 或 en_wsj.model 时遇到了一些问题。
其实我是在linux mint里面我把它们放在/usr/local/bin里面,把HUNPOS这个环境变量设置成这个路径,甚至尝试把这个路径传给@987654328中使用的参数path_to_bin @ 的 nltk/tag/hunpos.py 文件,但是当它识别到文件时,它会抛出这个错误:
>>> ht = HunposTagger('en_wsj.model','/usr/local/bin/en_wsj.model')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.4-py2.7.egg/nltk/tag/hunpos.py", line 89, in __init__
shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
有人知道发生了什么吗?
【问题讨论】:
标签: nltk pos-tagger