What are all possible pos tags of NLTK?

前端 未结 8 1716
你的背包
你的背包 2020-12-02 03:36

How do I find a list with all possible pos tags used by the Natural Language Toolkit (nltk)?

8条回答
  •  执念已碎
    2020-12-02 04:18

    The below can be useful to access a dict keyed by abbreviations:

    >>> from nltk.data import load
    >>> tagdict = load('help/tagsets/upenn_tagset.pickle')
    >>> tagdict['NN'][0]
    'noun, common, singular or mass'
    >>> tagdict.keys()
    ['PRP$', 'VBG', 'VBD', '``', 'VBN', ',', "''", 'VBP', 'WDT', ...
    

提交回复
热议问题