【发布时间】:2015-03-25 16:26:22
【问题描述】:
我安装了 32 位 Python 3.4.1,并且正在使用 NLTK 3。所有集合和模型都已安装。进入时
>>> text = nltk.word_tokenize("this is not working")
>>> text
['this', 'is', 'not', 'working']
>>> nltk.pos_tag(text)
或本地文件中的令牌
尝试使用 maxent_treebank_pos_tagger 的 pos_tag 时出现以下错误
Traceback (most recent call last):
File "<pyshell#72>", line 1, in <module>
nltk.pos_tag(text)
File "C:\Python34\lib\site-packages\nltk\tag\__init__.py", line 100, in pos_tag
tagger = load(_POS_TAGGER)
File "C:\Python34\lib\site-packages\nltk\data.py", line 779, in load
resource_val = pickle.load(opened_resource)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in position 0: ordinal not in range(128)
救命!
【问题讨论】:
标签: python nltk pos-tagger