Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
544 views
in Technique[技术] by (71.8m points)

python 2.7 - NLTK POS tagger not working

If I try this :

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

Output:

Traceback (most recent call last):
File "C:/Python27/pos.py", line 3, in <module>
nltk.pos_tag(text)
File "C:Python27libsite-packages
ltk-2.0.4-py2.7.egg
ltkag\__init__.py" ipos_tag
tagger = load(_POS_TAGGER)
File "C:Python27libsite-packages
ltk-2.0.4-py2.7.egg
ltkdata.py", line 605,in 
resource_val = pickle.load(_open(resource_url))
ImportError: No module named numpy.core.multiarray
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It seems that the saved word tokenizer requires numpy. You'll need to install it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...