词性标注测试——基于Penn Treebank Project

Alphabetical list of part-of-speech tags used in the Penn Treebank Project

from stanfordcorenlp import StanfordCoreNLP
path = r"D:\Code\stanford-corenlp-full-2018-10-05" 
nlp = StanfordCoreNLP(path)

1动词

VB、VBD、VBG、VBN、VBP、VBZ
——以write为例。

27.	VB	Verb, base form
28.	VBD	Verb, past tense
29.	VBG	Verb, gerund or present participle
30.	VBN	Verb, past participle
31.	VBP	Verb, non-3rd person singular present
32.	VBZ	Verb, 3rd person singular present

VB:动词,基本形式
VBD:动词,过去时
VBG:动词,动名词或现在分词
VBN:动词,过去分词
VBP:动词,非第三人称单数现在时
VBZ:动词,第三人称单数现在时

1.1 VB

sentence ="I love to write."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('I', 'PRP'), ('love', 'VBP'), ('to', 'TO'), ('write', 'VB'), ('.', '.')]

1.2VBD

sentence ="I wrote a book."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('I', 'PRP'), ('wrote', 'VBD'), ('a', 'DT'), ('book', 'NN'), ('.', '.')]

1.3VBG

sentence ="I'm writting a book."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('I', 'PRP'), ("'m", 'VBP'), ('writting', 'VBG'), ('a', 'DT'), ('book', 'NN'), ('.', '.')]

1.4VBN

sentence ="The books were written by the author."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('The', 'DT'), ('books', 'NNS'), ('were', 'VBD'), ('written', 'VBN'), ('by', 'IN'), ('the', 'DT'), ('author', 'NN'), ('.', '.')]

1.5VBP

sentence ="I write all day."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('I', 'PRP'), ('write', 'VBP'), ('all', 'DT'), ('day', 'NN'), ('.', '.')]

1.6VBZ

sentence ="she writes all day."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('she', 'PRP'), ('writes', 'VBZ'), ('all', 'DT'), ('day', 'NN'), ('.', '.')]

2名词

NN、NNS、NNP、NNPS

12.	NN	Noun, singular or mass
13.	NNS	Noun, plural
14.	NNP	Proper noun, singular
15.	NNPS	Proper noun, plural

NN:名词,单数或可数名词
NNS:名词,复数
NNP:专有名词,单数
NNPS:专有名词,复数

1.1NN

sentence ="The cat like to sleep."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('The', 'DT'), ('cat', 'NN'), ('like', 'IN'), ('to', 'TO'), ('sleep', 'VB'), ('.', '.')]

1.2NNS

sentence ="Cats like to sleep."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('Cats', 'NNS'), ('like', 'IN'), ('to', 'TO'), ('sleep', 'VB'), ('.', '.')]

1.3NNP

sentence ="John likes to sleep."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('John', 'NNP'), ('likes', 'VBZ'), ('to', 'TO'), ('sleep', 'VB'), ('.', '.')]

1.4NNPS

sentence ="The Beatles like to sleep."#referring to the famous music band "The Beatles."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('The', 'DT'), ('Beatles', 'NNPS'), ('like', 'IN'), ('to', 'TO'), ('sleep', 'VB'), ('.', '.')]

3形容词

JJ - 形容词
JJR - 形容词,比较级
JJS - 形容词,最高级

JJ - 形容词
JJR - 形容词,比较级
JJS - 形容词,最高级

3.1JJ

sentence ="You are lovely."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('You', 'PRP'), ('are', 'VBP'), ('lovely', 'JJ'), ('.', '.')]

3.2JJR

sentence ="You are slower."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('You', 'PRP'), ('are', 'VBP'), ('slower', 'JJR'), ('.', '.')]

3.3JJS

sentence ="You are the slowest one."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('You', 'PRP'), ('are', 'VBP'), ('the', 'DT'), ('slowest', 'JJS'), ('one', 'CD'), ('.', '.')]

4副词

20.	RB	Adverb
21.	RBR	Adverb, comparative
22.	RBS	Adverb, superlative

RB -副词
RBR - 副词,比较级
RBS - 副词,最高级

4.1RB

sentence ="You run quickly."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('You', 'PRP'), ('run', 'VBP'), ('quickly', 'RB'), ('.', '.')]

4.2RBR

sentence ="He runs faster in the class."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('He', 'PRP'), ('runs', 'VBZ'), ('faster', 'RBR'), ('in', 'IN'), ('the', 'DT'), ('class', 'NN'), ('.', '.')]

4.3RBS

?

5其他

sentence ="It's on the floor."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('It', 'PRP'), ("'s", 'VBZ'), ('on', 'IN'), ('the', 'DT'), ('floor', 'NN'), ('.', '.')]
sentence ="I like my dogs and cats."
pos_tag = nlp.pos_tag(sentence)
print(pos_tag)
[('I', 'PRP'), ('like', 'VBP'), ('my', 'PRP$'), ('dogs', 'NNS'), ('and', 'CC'), ('cats', 'NNS'), ('.', '.')]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值