NLTK pos tagger为同一个单词创建不同的标签。任何人都能解释一下吗?

时间:2018-03-14 14:17:43

标签: nlp nltk pos-tagger nltk-book

单词RR在一种情况下被标记为NN而在另一种情况下被标记为NNP。申请人在一个案件中被标记为NN而在另一个案件中被标记为JJ。为什么这个词在同一个词上有区别?不应该以大写字母开头的任何东西被标记为NNP吗?

testb
Out[45]: 
['applicant',
 'applicant',
 'applicant',
 'applicant',
 'RR',
 'RR',
 'Khan',
 'he',
 'how',
 'let',
 'she',
 'that',
 'there',
 'what',
 'where',
 'firm']

[nltk.pos_tag([i]) for i in testb]
Out[46]: 
[[('applicant', 'NN')],
 [('applicant', 'NN')],
 [('applicant', 'NN')],
 [('applicant', 'NN')],
 [('RR', 'NN')],
 [('RR', 'NN')],
 [('Khan', 'NNP')],
 [('he', 'PRP')],
 [('how', 'WRB')],
 [('let', 'VB')],
 [('she', 'PRP')],
 [('that', 'IN')],
 [('there', 'RB')],
 [('what', 'WP')],
 [('where', 'WRB')],
 [('firm', 'NN')]]

nltk.pos_tag(testb)
Out[47]: 
[('applicant', 'JJ'),
 ('applicant', 'NN'),
 ('applicant', 'NN'),
 ('applicant', 'JJ'),
 ('RR', 'NNP'),
 ('RR', 'NNP'),
 ('Khan', 'NNP'),
 ('he', 'PRP'),
 ('how', 'WRB'),
 ('let', 'VB'),
 ('she', 'PRP'),
 ('that', 'IN'),
 ('there', 'EX'),
 ('what', 'WP'),
 ('where', 'WRB'),
 ('firm', 'NN')] 

1 个答案:

答案 0 :(得分:0)

  • 词性分配在相同的单词之间可能会有所不同(例如 正确的工作人员他的正确生气
  • NLTK解析器具有非零误差范围