Jawaban:
Buku ini memiliki catatan cara menemukan bantuan pada set tag, misalnya:
nltk.help.upenn_tagset()
Yang lain mungkin serupa. (Catatan: Mungkin Anda pertama kali harus mengunduh tagsets
dari bagian Models helper untuk ini)
RB
artinya adverb
. ( Ini adalah contohnya ; atau lihat jawaban @ Suzana, yang menautkan Penn Treebank Tag Set ). Tapi Anda benar, builtin nltk.help.upenn_tagset('RB')
sangat membantu, dan disebutkan di awal nltk
buku ,
Untuk menghemat waktu beberapa orang, berikut adalah daftar yang saya ekstrak dari sebuah korpus kecil. Saya tidak tahu apakah sudah selesai, tetapi seharusnya memiliki sebagian besar (jika tidak semua) definisi bantuan dari upenn_tagset ...
CC : konjungsi, koordinasi
& 'n and both but either et for less minus neither nor or plus so
therefore times v. versus vs. whether yet
CD : angka, kardinal
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 : penentu
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 : ada di sana
there
DALAM : preposisi atau konjungsi, bawahan
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 : kata sifat atau angka, urut
third ill-mannered pre-war regrettable oiled calamitous first separable
ectoplasmic battery-powered participatory fourth still-to-be-named
multilingual multi-disciplinary ...
JJR : kata sifat, komparatif
bleaker braver breezier briefer brighter brisker broader bumper busier
calmer cheaper choosier cleaner clearer closer colder commoner costlier
cozier creamier crunchier cuter ...
JJS : kata sifat, superlatif
calmest cheapest choicest classiest cleanest clearest closest commonest
corniest costliest crassest creepiest crudest cutest darkest deadliest
dearest deepest densest dinkiest ...
LS : daftar item marker
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 : tambahan modal
can cannot could couldn't dare may might must need ought shall should
shouldn't will would
NN : kata benda, umum, tunggal atau massa
common-carrier cabbage knuckle-duster Casino afghan shed thermostat
investment slide humour falloff slick wind hyena override subhumanity
machinist ...
NNP : kata benda, tepat, tunggal
Motown Venneboerger Czestochwa Ranzer Conchita Trumplane Christos
Oceanside Escobar Kreisler Sawyer Cougar Yvette Ervin ODI Darryl CTCA
Shannon A.K.C. Meltex Liverpool ...
NNS : kata benda, umum, jamak
undergraduates scotches bric-a-brac products bodyguards facets coasts
divestitures storehouses designs clubs fragrances averages
subjectivists apprehensions muses factory-jobs ...
PDT : pra-penentu
all both half many quite such sure this
POS : penanda genitif
' 's
PRP : kata ganti, pribadi
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 $: kata ganti, posesif
her his mine my our ours their thy your
RB : kata keterangan
occasionally unabatingly maddeningly adventurously professedly
stirringly prominently technologically magisterially predominately
swiftly fiscally pitilessly ...
RBR : kata keterangan, komparatif
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 : kata keterangan, superlatif
best biggest bluntest earliest farthest first furthest hardest
heartiest highest largest least less most nearest second tightest worst
RP : partikel
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
TO : "to" sebagai preposisi atau penanda infinitif
to
UH : kata seru
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 : kata kerja, bentuk dasar
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 : kata kerja, past tense
dipped pleaded swiped regummed soaked tidied convened halted registered
cushioned exacted snubbed strode aimed adopted belied figgered
speculated wore appreciated contemplated ...
VBG : kata kerja, present participle atau gerund
telegraphing stirring focusing angering judging stalling lactating
hankerin' alleging veering capping approaching traveling besieging
encrypting interrupting erasing wincing ...
VBN : kata kerja, past participle
multihulled dilapidated aerosolized chaired languished panelized used
experimented flourished imitated reunifed factored condensed sheared
unsettled primed dubbed desired ...
VBP : kata kerja, present tense, bukan ke 3 orang tunggal
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 : kata kerja, present tense, 3rd person singular
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 : Kata ganti WH
that what whatever whatsoever which who whom whosoever
WRB : Wh-adverbia
how however whence whenever where whereby whereever wherein whereof why
$
, ''
, (
, )
, ,
, --
, .
, :
, FW
, NNPS
, SYM
, WP$
, [dua tanda kutip mundur]. Lihat nltk.help.upenn_tagset()
.
Set tag tergantung pada corpus yang digunakan untuk melatih tagger. Tagger default nltk.pos_tag()
menggunakan Penn Treebank Tag Set .
Di NLTK 2, Anda dapat memeriksa tagger mana yang merupakan tagger default sebagai berikut:
import nltk
nltk.tag._POS_TAGGER
>>> 'taggers/maxent_treebank_pos_tagger/english.pickle'
Itu berarti bahwa itu adalah tagger Entropy Maksimum yang dilatih di Treebank corpus.
nltk.tag._POS_TAGGER
tidak ada lagi di NLTK 3 tetapi dokumentasi menyatakan bahwa tag -off-the-shelf masih menggunakan tagset Penn Treebank.
nltk.tag._POS_TAGGER
tidak dijalankan dan tidak ada instruksi khusus yang diberikan tentang apa yang harus diimpor. Juga, mengetahui bahwa tagger yang digunakan adalah setengah dari jawabannya, pertanyaannya adalah meminta untuk mendapatkan daftar semua tag yang mungkin di dalam tagger
Di bawah ini dapat bermanfaat untuk mengakses dict yang dikunci dengan singkatan:
>>> 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', ...
Referensi tersedia di situs resmi
Salin dan tempel dari sana:
Anda dapat mengunduh daftar di sini: ftp://ftp.cis.upenn.edu/pub/treebank/doc/tagguide.ps.gz . Ini termasuk bagian-bagian pembicaraan yang membingungkan, huruf besar, dan konvensi lainnya. Juga, wikipedia memiliki bagian menarik yang mirip dengan ini. Bagian: Tag sebagian ucapan yang digunakan.
['LS', 'TO', 'VBN', "''", 'WP', 'UH', 'VBG', 'JJ', 'VBZ', '--', 'VBP', 'NN', 'DT', 'PRP', ':', 'WP$', 'NNPS', 'PRP$', 'WDT', '(', ')', '.', ',', '``', '$', 'RB', 'RBR', 'RBS', 'VBD', 'IN', 'FW', 'RP', 'JJR', 'JJS', 'PDT', 'MD', 'VB', 'WRB', 'NNP', 'EX', 'NNS', 'SYM', 'CC', 'CD', 'POS']
Berdasarkan metode Doug Shore tetapi membuatnya lebih ramah copy-paste
Jalankan saja kata demi kata ini.
import nltk
nltk.download('tagsets')
nltk.help.upenn_tagset()
nltk.tag._POS_TAGGER
tidak akan bekerja Ini akan memberikan AttributeError: module 'nltk.tag' tidak memiliki atribut '_POS_TAGGER' . Ini tidak tersedia di NLTK 3 lagi.