Python NLTk位置标记器错误
我已经安装了32位Python 3.4.1,并且正在使用NLTK 3。所有集合和模型都已安装。进入时Python NLTk位置标记器错误,python,nltk,pos-tagger,Python,Nltk,Pos Tagger,我已经安装了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\u treebank\u pos\u tagger的pos
>>> text = nltk.word_tokenize("this is not working")
>>> text
['this', 'is', 'not', 'working']
>>> nltk.pos_tag(text)
或者本地文件中的令牌
我在尝试使用maxent\u treebank\u pos\u tagger的pos\u标记时遇到以下错误
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)
救命啊 我追踪到错误是在Windows7系统和编码上 我从这条线索中找到了答案, 在Mac10.10系统上试用,改变了编码,效果很好