Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\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
like image 467
Vinit Gaikwad Avatar asked Jan 24 '13 17:01

Vinit Gaikwad


People also ask

Which NLTK function is used for POS tagging?

with the word_tokenize() function. Then the tokens are POS tagged with the function pos_tag() .

How do you use POS tagger?

In simple words, we can say that POS tagging is a task of labelling each word in a sentence with its appropriate part of speech. We already know that parts of speech include nouns, verb, adverbs, adjectives, pronouns, conjunction and their sub-categories.

Which token attributes can be used to extract POS tags?

To obtain fine-grained POS tags, we could use the tag_ attribute.


1 Answers

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

like image 196
Danica Avatar answered Sep 28 '22 09:09

Danica