如果我试试这个:
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
答案 0 :(得分:10)
似乎保存的单词标记器需要numpy。您需要install it。
答案 1 :(得分:3)
使用以下命令安装numpy:
sudo pip install -U numpy