POS Challenge - OPTIONAL

Just for fun, we've developed a game to test your knowledge of Part of Speech tags. The object of the game is to write a body of text that contains as many different fine-grained tags as possible. The highest possible score is 100 (or thereabouts). Points are awarded for the number of unique tags used, and for the fewest possible tokens used. Below is an example. Feel free to post your results in the Q&A Forum for this lecture, and good luck!


In [4]:
# Perform standard imports
import spacy
nlp = spacy.load('en_core_web_sm')

# Import the game script
import game

In [5]:
# Enter your text here:
text = u"The quick brown fox jumped over the lazy dog's back."

In [6]:
# Make your Doc object and pass it into the scorer:
doc = nlp(text)
print(game.scorer(doc))


Unique tags: 7
Tokens used: 12
SCORE: 9
CONGRATULATIONS!


In [7]:
# For practice, visualize your fine-grained POS tags (shown in the third column):
print(f"{'TOKEN':{10}} {'COARSE':{8}} {'FINE':{6}} {'DESCRIPTION'}")
print(f"{'-----':{10}} {'------':{8}} {'----':{6}} {'-----------'}")

for token in doc:
    print(f'{token.text:{10}} {token.pos_:{8}} {token.tag_:{6}} {spacy.explain(token.tag_)}')


TOKEN      COARSE   FINE   DESCRIPTION
-----      ------   ----   -----------
The        DET      DT     determiner
quick      ADJ      JJ     adjective
brown      ADJ      JJ     adjective
fox        NOUN     NN     noun, singular or mass
jumped     VERB     VBD    verb, past tense
over       ADP      IN     conjunction, subordinating or preposition
the        DET      DT     determiner
lazy       ADJ      JJ     adjective
dog        NOUN     NN     noun, singular or mass
's         PART     POS    possessive ending
back       NOUN     NN     noun, singular or mass
.          PUNCT    .      punctuation mark, sentence closer

Fine-grained Part-of-speech Tags

Coarse POS TagDescriptionFine-grained TagDescriptionMorphology
1.ADJadjectiveAFXaffixHyph=yes
2.ADJJJadjectiveDegree=pos
3.ADJJJRadjective, comparativeDegree=comp
4.ADJJJSadjective, superlativeDegree=sup
5.ADJPDTpredeterminerAdjType=pdt PronType=prn
6.ADJPRP\$pronoun, possessivePronType=prs Poss=yes
7.ADJWDTwh-determinerPronType=int rel
8.ADJWP\$wh-pronoun, possessivePoss=yes PronType=int rel
9.ADPadpositionINconjunction, subordinating or preposition
10.ADVadverbEXexistential thereAdvType=ex
11.ADVRBadverbDegree=pos
12.ADVRBRadverb, comparativeDegree=comp
13.ADVRBSadverb, superlativeDegree=sup
14.ADVWRBwh-adverbPronType=int rel
15.CONJconjunctionCCconjunction, coordinatingConjType=coor
16.DETdeterminerDTdeterminer
17.INTJinterjectionUHinterjection
18.NOUNnounNNnoun, singular or massNumber=sing
19.NOUNNNSnoun, pluralNumber=plur
20.NOUNWPwh-pronoun, personalPronType=int rel
21.NUMnumeralCDcardinal numberNumType=card
22.PARTparticlePOSpossessive endingPoss=yes
23.PARTRPadverb, particle
24.PARTTOinfinitival toPartType=inf VerbForm=inf
25.PRONpronounPRPpronoun, personalPronType=prs
26.PROPNproper nounNNPnoun, proper singularNounType=prop Number=sign
27.PROPNNNPSnoun, proper pluralNounType=prop Number=plur
28.PUNCTpunctuation-LRB-left round bracketPunctType=brck PunctSide=ini
29.PUNCT-RRB-right round bracketPunctType=brck PunctSide=fin
30.PUNCT,punctuation mark, commaPunctType=comm
31.PUNCT:punctuation mark, colon or ellipsis
32.PUNCT.punctuation mark, sentence closerPunctType=peri
33.PUNCT''closing quotation markPunctType=quot PunctSide=fin
34.PUNCT""closing quotation markPunctType=quot PunctSide=fin
35.PUNCT``opening quotation markPunctType=quot PunctSide=ini
36.PUNCTHYPHpunctuation mark, hyphenPunctType=dash
37.PUNCTLSlist item markerNumType=ord
38.PUNCTNFPsuperfluous punctuation
39.SYMsymbol#symbol, number signSymType=numbersign
40.SYM\$symbol, currencySymType=currency
41.SYMSYMsymbol
42.VERBverbBESauxiliary "be"
43.VERBHVSforms of "have"
44.VERBMDverb, modal auxiliaryVerbType=mod
45.VERBVBverb, base formVerbForm=inf
46.VERBVBDverb, past tenseVerbForm=fin Tense=past
47.VERBVBGverb, gerund or present participleVerbForm=part Tense=pres Aspect=prog
48.VERBVBNverb, past participleVerbForm=part Tense=past Aspect=perf
49.VERBVBPverb, non-3rd person singular presentVerbForm=fin Tense=pres
50.VERBVBZverb, 3rd person singular presentVerbForm=fin Tense=pres Number=sing Person=3
51.XotherADDemail
52.XFWforeign wordForeign=yes
53.XGWadditional word in multi-word expression
54.XXXunknown
55.SPACEspace_SPspace
56.NILmissing tag