[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

POS Tagging

Hephzibah

3/13/2010 12:30:00 AM

I just started working on POS tagging with these codes:

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

Python prompted me to download a resource with these codes:

Resource 'taggers/maxent_treebank_pos_tagger/english.pickle' not
found. Please use the NLTK Downloader to obtain the resource:

I download the resources available using nltk.download(). But I
couldn't run POS tagger. Python gave my the following message:

Traceback (most recent call last):
File "C:/Python25/tag practices.py", line 5, in <module>
print nltk.pos_tag(text)
File "C:\Python25\lib\site-packages\nltk\tag\__init__.py", line 62,
in pos_tag
tagger = nltk.data.load(_POS_TAGGER)
File "C:\Python25\lib\site-packages\nltk\data.py", line 492, in load
resource_val = pickle.load(_open(resource_url))
File "C:\Python25\lib\site-packages\nltk\classify\maxent.py", line
57, in <module>
import numpy
ImportError: No module named numpy

Can someone pls. tell me what I'm supposed to do next?

Thanks,
Hephzibah
2 Answers

John Bokma

3/13/2010 12:34:00 AM

0

Hephzibah <morecrown@gmail.com> writes:

> ImportError: No module named numpy
>
> Can someone pls. tell me what I'm supposed to do next?

Install numpy would be my first guess.

--
John Bokma j3b

Hacking & Hiking in Mexico - http://john...
http://castle... - Perl & Python Development

Hephzibah

3/13/2010 4:37:00 AM

0

On Mar 12, 4:33 pm, John Bokma <j...@castleamber.com> wrote:
> Hephzibah <morecr...@gmail.com> writes:
> > ImportError: No module named numpy
>
> > Can someone pls. tell me what I'm supposed to do next?
>
> Install numpy would be my first guess.
>
> --
> John Bokma                                                               j3b
>
> Hacking & Hiking in Mexico -  http://johnbokma.com/http://castlea... Perl & Python Development

Thanks so much

I've been able to resolve the issue.
What I did was to run the program after downloading and installing
i. a newer version of Python -version 26
ii. pyPAML
iii.numpy
iv.matplotlib; all from www.nltk.org.

regards,
Hephzibah