Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python NLTk位置标记器错误_Python_Nltk_Pos Tagger - Fatal编程技术网

Python NLTk位置标记器错误

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

我已经安装了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\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系统上试用,改变了编码,效果很好