nltk pos_tag usage

后端 未结 3 1887
闹比i
闹比i 2021-01-12 04:41

I am trying to use speech tagging in NLTK and have used this command:

>>> text = nltk.word_tokenize(\"And now for something completely different\")
         


        
相关标签:
3条回答
  • 2021-01-12 05:14

    Over 50 corpora and lexical resources such as WordNet: http://www.nltk.org/nltk_data/ for free. Use http://nltk.github.com/nltk_data/ as server index instead of googlecode Google code 401: Authorization Required

    0 讨论(0)
  • 2021-01-12 05:32

    If you don't want to use the downloader gui, you can just use the following commands in a python or ipython shell:

    import nltk
    nltk.download('punkt')
    nltk.download('maxent_treebank_pos_tagger')
    
    0 讨论(0)
  • 2021-01-12 05:34

    Your Python installation is not able to reach maxent or treemap.

    First, check if the tagger is indeed there: Start Python from the command line.

    >>> import nltk

    Then you can check using

    >>> dir (nltk)

    Look through the list to see if maxent and treebank are both there.

    Easier would be to type

    >>> "maxent" in dir(nltk)
    >>> True
    >>> "treebank" in dir(nltk)
    >>> True
    

    Use nltk.download() --> Models tab and check to see if the treemap tagger shows as installed. You should also try downloading the tagger again.

    NLTK Downloader, Models Tab

    0 讨论(0)
提交回复
热议问题