NLTK Default Tagger Treebank Tag Coverage

For some research I’m doing with Michael D. Healy, I need to measure part-of-speech tagger coverage and performance. To that end, I’ve added a new script to nltk-trainer: analyze_tagger_coverage.py. This script will tag every sentence of a corpus and count how many times it produces each tag. If you also use the --metrics option, and the corpus reader provides a tagged_sents() method, then you can get detailed performance metrics by comparing the tagger’s results against the actual tags.

NLTK Default Tagger Performance on Treebank

Below is a table showing the performance details of the NLTK 2.0b9 default tagger on the treebank corpus, which you can see for yourself by running python analyze_tagger_coverage.py treebank --metrics. The default tagger is 99.57% accurate on treebank, and below you can see exactly on which tags it fails. The Found column shows the number of occurrences of each tag produced by the default tagger, while the Actual column shows the actual number of occurrences in the treebank corpus. Precision and Recall, which I’ve explained in the context of classification, show the performance for each tag. If the Precision is less than 1, that means the tagger gave the tag to a word that it shouldn’t have (a false positive). If the Recall is less than 1, it means the tagger did not give the tag to a word that it should have (a false negative).

TagFoundActualPrecisionRecall
#161611
$72472411
‘69469411
,4887488611
-LRB-12012011
-NONE-6591659211
-RRB-12612611
.3874387411
:56356311
CC2271226511
CD354735460.9990.999
DT8170816511
EX888811
FW4411
IN988098570.99130.958
JJ580358340.99130.9789
JJR38638110.9149
JJS1851820.96671
LS121310.8571
MD92792711
NN13166131660.99170.9879
NNP942794100.99480.994
NNPS2462440.99030.9533
NNS605560470.99520.9972
PDT212710.6667
POS82482411
PRP1716171611
PRP$76676611
RB280028220.99310.975
RBR13013610.875
RBS333510.5
RP21321611
SYM1111
TO2180217911
UH3311
VB256225540.99141
VBD303530430.99020.9807
VBG145814600.99650.9982
VBN214521340.98850.9957
VBP131813210.99310.9828
VBZ212421250.99370.9906
WDT44044510.8333
WP24124111
WP$141411
WRB17817811
“71271211

Unknown Words in Treebank

Suprisingly, the treebank corpus contains 6592 words tags with -NONE-. But it’s not that bad, since it’s only 440 unique words, and they are not regular words at all: *EXP*-2, *T*-91, *-106, and many more similar looking tokens.