What is NLTK POS tagger asking me to download?

后端 未结 6 2314
感动是毒
感动是毒 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条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 03:14

    When you type nltk.download() in Python, an NLTK Downloader interface gets displayed automatically.
    Click on Models and choose maxent_treebank_pos_. It gets installed automatically.

    import nltk 
    text=nltk.word_tokenize("We are going out.Just you and me.")
    print nltk.pos_tag(text)
    [('We', 'PRP'), ('are', 'VBP'), ('going', 'VBG'), ('out.Just', 'JJ'),
     ('you', 'PRP'), ('and', 'CC'), ('me', 'PRP'), ('.', '.')]
    

提交回复
热议问题