6

如果我试试这个:

import nltk
text = nltk.word_tokenize("And now for something completely different")
nltk.pos_tag(text)

输出:

Traceback (most recent call last):
File "C:/Python27/pos.py", line 3, in <module>
nltk.pos_tag(text)
File "C:\Python27\lib\site-packages\nltk-2.0.4-py2.7.egg\nltk\tag\__init__.py" ipos_tag
tagger = load(_POS_TAGGER)
File "C:\Python27\lib\site-packages\nltk-2.0.4-py2.7.egg\nltk\data.py", line 605,in 
resource_val = pickle.load(_open(resource_url))
ImportError: No module named numpy.core.multiarray
4

2 回答 2

10

似乎保存的单词标记器需要numpy。您需要安装它

于 2013-01-24T18:22:45.467 回答
3

使用以下命令安装 numpy:

sudo pip install -U numpy
于 2015-02-24T14:45:22.177 回答