POS Tagging

Discussion in 'Python' started by Hephzibah, Mar 13, 2010.

  1. Hephzibah

    Hephzibah Guest

    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
     
    Hephzibah, Mar 13, 2010
    #1
    1. Advertising

  2. Hephzibah

    John Bokma Guest

    Hephzibah <> 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://castleamber.com/ - Perl & Python Development
     
    John Bokma, Mar 13, 2010
    #2
    1. Advertising

  3. Hephzibah

    Hephzibah Guest

    On Mar 12, 4:33 pm, John Bokma <> wrote:
    > Hephzibah <> 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://castleamber.com/- 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
     
    Hephzibah, Mar 13, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    355
  2. Replies:
    0
    Views:
    316
  3. darrel
    Replies:
    1
    Views:
    1,368
    Karl Seguin
    Dec 20, 2005
  4. Replies:
    0
    Views:
    2,765
  5. prati
    Replies:
    0
    Views:
    453
    prati
    Oct 27, 2012
Loading...

Share This Page