Comment trouver une liste avec toutes les balises POS possibles utilisées par Natural Language Toolkit (nltk)?
Le livre indique comment trouver de l'aide sur les jeux de balises, par exemple:
nltk.help.upenn_tagset()
D'autres sont probablement similaires. (Remarque: vous devez peut-être d'abord télécharger tagsets
à partir de la section Models de l'aide au téléchargement)
Pour gagner du temps, voici une liste que j'ai extraite d'un petit corpus. Je ne sais pas s'il est complet, mais il devrait avoir la plupart (sinon la totalité) des définitions d'aide de upenn_tagset ...
CC: conjonction, coordination
& 'n and both but either et for less minus neither nor or plus so
therefore times v. versus vs. whether yet
CD: numéral, cardinal
mid-1890 nine-thirty forty-two one-tenth ten million 0.5 one forty-
seven 1987 twenty '79 zero two 78-degrees eighty-four IX '60s .025
fifteen 271,124 dozen quintillion DM2,000 ...
DT: déterminant
all an another any both del each either every half la many much nary
neither no some such that the them these this those
EX: existential il
there
IN: préposition ou conjonction, subordination
astride among uppon whether out inside pro despite on by throughout
below within for towards near behind atop around if like until below
next into if beside ...
JJ: adjectif ou numéral, ordinal
third ill-mannered pre-war regrettable oiled calamitous first separable
ectoplasmic battery-powered participatory fourth still-to-be-named
multilingual multi-disciplinary ...
JJR: adjectif, comparatif
bleaker braver breezier briefer brighter brisker broader bumper busier
calmer cheaper choosier cleaner clearer closer colder commoner costlier
cozier creamier crunchier cuter ...
JJS: adjectif, superlatif
calmest cheapest choicest classiest cleanest clearest closest commonest
corniest costliest crassest creepiest crudest cutest darkest deadliest
dearest deepest densest dinkiest ...
LS: marqueur d'élément de liste
A A. B B. C C. D E F First G H I J K One SP-44001 SP-44002 SP-44005
SP-44007 Second Third Three Two * a b c d first five four one six three
two
MD: auxiliaire modal
can cannot could couldn't dare may might must need ought shall should
shouldn't will would
NN: nom, commun, singulier ou masse
common-carrier cabbage knuckle-duster Casino afghan shed thermostat
investment slide humour falloff slick wind hyena override subhumanity
machinist ...
NNP: nom, propre, singulier
Motown Venneboerger Czestochwa Ranzer Conchita Trumplane Christos
Oceanside Escobar Kreisler Sawyer Cougar Yvette Ervin ODI Darryl CTCA
Shannon A.K.C. Meltex Liverpool ...
NNS: nom, commun, pluriel
undergraduates scotches bric-a-brac products bodyguards facets coasts
divestitures storehouses designs clubs fragrances averages
subjectivists apprehensions muses factory-jobs ...
PDT: prédéterminé
all both half many quite such sure this
POS: marqueur génitif
' 's
PRP: pronom personnel
hers herself him himself hisself it itself me myself one oneself ours
ourselves ownself self she thee theirs them themselves they thou thy us
PRP$: pronom, possessif
her his mine my our ours their thy your
RB: adverbe
occasionally unabatingly maddeningly adventurously professedly
stirringly prominently technologically magisterially predominately
swiftly fiscally pitilessly ...
RBR: adverbe, comparatif
further gloomier grander graver greater grimmer harder harsher
healthier heavier higher however larger later leaner lengthier less-
perfectly lesser lonelier longer louder lower more ...
RBS: adverbe, superlatif
best biggest bluntest earliest farthest first furthest hardest
heartiest highest largest least less most nearest second tightest worst
RP: particule
aboard about across along apart around aside at away back before behind
by crop down ever fast for forth from go high i.e. in into just later
low more off on open out over per pie raising start teeth that through
under unto up up-pp upon whole with you
À: "à" comme marqueur de préposition ou infinitif
to
EUH: interjection
Goodbye Goody Gosh Wow Jeepers Jee-sus Hubba Hey Kee-reist Oops amen
huh howdy uh dammit whammo shucks heck anyways whodunnit honey golly
man baby diddle hush sonuvabitch ...
VB: verbe, forme de base
ask assemble assess assign assume atone attention avoid bake balkanize
bank begin behold believe bend benefit bevel beware bless boil bomb
boost brace break bring broil brush build ...
VBD: verbe, passé
dipped pleaded swiped regummed soaked tidied convened halted registered
cushioned exacted snubbed strode aimed adopted belied figgered
speculated wore appreciated contemplated ...
VBG: verbe, participe présent ou gérondif
telegraphing stirring focusing angering judging stalling lactating
hankerin' alleging veering capping approaching traveling besieging
encrypting interrupting erasing wincing ...
VBN: verbe, participe passé
multihulled dilapidated aerosolized chaired languished panelized used
experimented flourished imitated reunifed factored condensed sheared
unsettled primed dubbed desired ...
VBP: verbe, présent, pas à la 3ème personne du singulier
predominate wrap resort sue twist spill cure lengthen brush terminate
appear tend stray glisten obtain comprise detest tease attract
emphasize mold postpone sever return wag ...
VBZ: verbe, présent, 3ème personne du singulier
bases reconstructs marks mixes displeases seals carps weaves snatches
slumps stretches authorizes smolders pictures emerges stockpiles
seduces fizzes uses bolsters slaps speaks pleads ...
WDT: WH-determiner
that what whatever which whichever
WP: WH-pronom
that what whatever whatsoever which who whom whosoever
WRB: Wh-adverbe
how however whence whenever where whereby whereever wherein whereof why
Le jeu de balises dépend du corpus utilisé pour former le tagueur. Le tagger par défaut de nltk.pos_tag()
utilise le Penn Treebank Tag Set .
Dans NLTK 2, vous pouvez vérifier quel tagger est le tagger par défaut comme suit:
import nltk
nltk.tag._POS_TAGGER
>>> 'taggers/maxent_treebank_pos_tagger/english.pickle'
Cela signifie que c'est un tagueur d'entropie maximum formé sur le corpus de Treebank.
nltk.tag._POS_TAGGER
n'existe plus dans NLTK 3 mais la documentation indique que le tagger standard utilise toujours le jeu de clés Penn Treebank.
Les éléments ci-dessous peuvent être utiles pour accéder à un dicté à l'aide d'abréviations
>>> 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', ...
La référence est disponible sur le site officiel
Copier et coller à partir de là:
Vous pouvez télécharger la liste ici: ftp://ftp.cis.upenn.edu/pub/treebank/doc/tagguide.ps.gz . Cela inclut des parties de discours confuses, la capitalisation et d’autres conventions. En outre, wikipedia a une section intéressante similaire à celle-ci. Section: Tags de partie du discours utilisés.