What is NLTK POS tagger asking me to download?

后端 未结 6 2313
感动是毒
感动是毒 2020-12-03 02:51

I just started using a part-of-speech tagger, and I am facing many problems.

I started POS tagging with the following:

import nltk
text=nltk.word_to         


        
6条回答
  •  -上瘾入骨i
    2020-12-03 03:29

    From NLTK versions higher than v3.2, please use:

    >>> import nltk
    >>> nltk.__version__
    '3.2.1'
    >>> nltk.download('averaged_perceptron_tagger')
    [nltk_data] Downloading package averaged_perceptron_tagger to
    [nltk_data]     /home/alvas/nltk_data...
    [nltk_data]   Package averaged_perceptron_tagger is already up-to-date!
    True
    

    For NLTK versions using the old MaxEnt model, i.e. v3.1 and below, please use:

    >>> import nltk
    >>> nltk.download('maxent_treebank_pos_tagger')
    [nltk_data] Downloading package maxent_treebank_pos_tagger to
    [nltk_data]     /home/alvas/nltk_data...
    [nltk_data]   Package maxent_treebank_pos_tagger is already up-to-date!
    True
    

    For more details on the change in the default pos_tag, please see https://github.com/nltk/nltk/pull/1143

提交回复
热议问题