Подтвердить что ты не робот

Каковы все возможные позиционные метки NLTK?

Как найти список со всеми возможными позиционными тегами, которые используются в наборе инструментов Natural Language Toolkit (nltk)?

4b9b3361

Ответ 1

В книге есть заметка о том, как найти справку по наборам тегов, например:

nltk.help.upenn_tagset()

Другие, вероятно, похожи. (Примечание. Возможно, вам сначала нужно загрузить tagsets из раздела "Вспомогательные файлы для скачивания" ).

Ответ 2

Набор тегов зависит от корпуса, который использовался для обучения метки. По умолчанию теггер nltk.pos_tag() использует Набор тегов Penn Treebank.

В NLTK 2 вы можете проверить, какой теггер является тегом по умолчанию, следующим образом:

import nltk
nltk.tag._POS_TAGGER
>>> 'taggers/maxent_treebank_pos_tagger/english.pickle'

Это означает, что это теггер максимальной энтропии, обученный на корпусе Treebank.

nltk.tag._POS_TAGGER больше не существует в NLTK 3, но в документации говорится, что готовый теггер по-прежнему использует набор тегов Penn Treebank,

Ответ 3

Чтобы спасти некоторых людей некоторое время, вот список, который я извлек из небольшого корпуса. Я не знаю, полнота ли она, но она должна иметь большинство (если не все) определений помощи из upenn_tagset...

CC: соединение, координация

& 'n and both but either et for less minus neither nor or plus so
therefore times v. versus vs. whether yet

CD: цифра, кардинал

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: определение

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: экзистенциальная там

there

IN: предлог или соединение, подчинение

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: прилагательное или цифра, порядковый номер

third ill-mannered pre-war regrettable oiled calamitous first separable
ectoplasmic battery-powered participatory fourth still-to-be-named
multilingual multi-disciplinary ...

JJR: прилагательное, сравнительное

bleaker braver breezier briefer brighter brisker broader bumper busier
calmer cheaper choosier cleaner clearer closer colder commoner costlier
cozier creamier crunchier cuter ...

JJS: прилагательное, превосходное

calmest cheapest choicest classiest cleanest clearest closest commonest
corniest costliest crassest creepiest crudest cutest darkest deadliest
dearest deepest densest dinkiest ...

LS: маркер элемента списка

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: модальный вспомогательный

can cannot could couldn't dare may might must need ought shall should
shouldn't will would

NN: существительное, общее, единственное или массовое

common-carrier cabbage knuckle-duster Casino afghan shed thermostat
investment slide humour falloff slick wind hyena override subhumanity
machinist ...

NNP: существительное, собственное, единственное

Motown Venneboerger Czestochwa Ranzer Conchita Trumplane Christos
Oceanside Escobar Kreisler Sawyer Cougar Yvette Ervin ODI Darryl CTCA
Shannon A.K.C. Meltex Liverpool ...

NNS: существительное, общее, множественное число

undergraduates scotches bric-a-brac products bodyguards facets coasts
divestitures storehouses designs clubs fragrances averages
subjectivists apprehensions muses factory-jobs ...

PDT: предварительный определитель

all both half many quite such sure this

POS: родительный маркер

' 's

PRP: местоимение, личное

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 $: местоимение, притяжательное

her his mine my our ours their thy your

RB: наречие

occasionally unabatingly maddeningly adventurously professedly
stirringly prominently technologically magisterially predominately
swiftly fiscally pitilessly ...

RBR: наречие, сравнительное

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: наречие, превосходное

best biggest bluntest earliest farthest first furthest hardest
heartiest highest largest least less most nearest second tightest worst

RP: частица

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" в качестве предлога или указателя неопределенности

to

UH: междометие

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: глагол, базовая форма

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: глагол, прошедшее время

dipped pleaded swiped regummed soaked tidied convened halted registered
cushioned exacted snubbed strode aimed adopted belied figgered
speculated wore appreciated contemplated ...

VBG: глагол, настоящее причастие или герунд

telegraphing stirring focusing angering judging stalling lactating
hankerin' alleging veering capping approaching traveling besieging
encrypting interrupting erasing wincing ...

VBN: глагол, прошедшее причастие

multihulled dilapidated aerosolized chaired languished panelized used
experimented flourished imitated reunifed factored condensed sheared
unsettled primed dubbed desired ...

VBP: глагол, настоящее время, а не третий человек в единственном числе

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: глагол, настоящее время, 3-х человек в единственном числе

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-определитель

that what whatever which whichever

WP: WH-местоимение

that what whatever whatsoever which who whom whosoever

WRB: Wh-adverb

how however whence whenever where whereby whereever wherein whereof why

Ответ 4

Ниже может быть полезно получить доступ к dict, обозначенному аббревиатурами:

>>> 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', ...

Ответ 5

Ссылка доступна на официальном сайте

Скопировать и вставить оттуда:

  • CC | Координационное соединение |
  • CD | Кардинальный номер |
  • DT | Определитель |
  • EX | Existential there |
  • FW | Иностранное слово |
  • IN | Предпозиция или подчинение |
  • JJ | Прилагательное |
  • JJR | Прилагательное, сравнительное |
  • JJS | Прилагательное, превосходное |
  • LS | Маркер элемента списка |
  • MD | Модальные |
  • NN | Существительное, единственное или массовое |
  • NNS | Существительное, множественное число
  • NNP | Собственное существительное, единственное |
  • NNPS | Собственное существительное, множественное число
  • PDT | Predeterminer |
  • POS | Одержимый конец |
  • PRP | Личное местоимение |
  • PRP $| Притяжательное местоимение |
  • RB | Наречие |
  • RBR | Наречие, сравнительное |
  • RBS | Наречие, превосходное |
  • RP | Частица |
  • SYM | Символ |
  • TO | to |
  • UH | Междометие |
  • VB | Глагол, базовая форма |
  • VBD | Глагол, прошедшее время |
  • VBG | Глагол, герунд или настоящее причастие |
  • VBN | Глагол, прошедшее причастие |
  • VBP | Глагол, не являющийся третьим лицом, присутствующий в настоящее время |
  • VBZ | Глагол, 3-е лицо, единственное настоящее |
  • WDT | Wh-определитель |
  • WP | Wh-местоимение |
  • WP $| Притяжательный wh-местоимение |
  • WRB | Wh-adverb |

Ответ 6

Вы можете скачать список здесь: ftp://ftp.cis.upenn.edu/pub/treebank/doc/tagguide.ps.gz. Он включает в себя запутывающие части речи, капитализации и другие соглашения. Кроме того, wikipedia имеет интересный раздел, подобный этому. Раздел: Используются теги с использованием части речи.