Mingzhi Yu
Mingzhi Yu

Reputation: 51

What is the tagset for NLTK perceptron tagger?

What is the tagset for NLTK perceptron tagger? And what is the corpus used for the pre-trained model?

I have tried to find the official information from the NLTK website. But they don't have that.

Upvotes: 5

Views: 3889

Answers (1)

alvas
alvas

Reputation: 122168

From https://github.com/nltk/nltk/pull/1143, we see that it's a port from https://spacy.io/blog/part-of-speech-pos-tagger-in-python

The tagset in the trained tagdict includes the following tags:

>>> from nltk.tag import PerceptronTagger
>>> tagger = PerceptronTagger()
>>> set(tagger.tagdict.values())
set(['PRP$', 'VBG', 'VBD', '``', 'VBN', "''", 'VBP', 'WDT', 'JJ', 'WP', 'VBZ', 'DT', '#', '$', 'NN', ')', '(', ',', '.', 'TO', 'PRP', 'RB', ':', 'NNS', 'NNP', 'VB', 'WRB', 'CC', 'CD', 'EX', 'IN', 'WP$', 'MD', 'JJS', 'JJR'])

The full tagset is:

>>> sorted(tagger.classes)
['#', '$', "''", '(', ')', ',', '.', ':', 'CC', 'CD', 'DT', 'EX', 'FW', 'IN', 'JJ', 'JJR', 'JJS', 'LS', 'MD', 'NN', 'NNP', 'NNPS', 'NNS', 'PDT', 'POS', 'PRP', 'PRP$', 'RB', 'RBR', 'RBS', 'RP', 'SYM', 'TO', 'UH', 'VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ', 'WDT', 'WP', 'WP$', 'WRB', '``']

It's the Penn Treebank Tagset from: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html

Upvotes: 7

Related Questions