def combine_pos_tag(self, pos_tag):
noun = ['NN', 'NNS', 'NNP', 'NNPS']
adjective = ['JJ', 'JJR', 'JJS']
adverb = ['RB', 'RBR', 'RBS']
verb = ['VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ']
wh = ['WDT', 'WP', 'WRB']
if pos_tag in noun:
return 'NN'
elif pos_tag in adjective:
return 'JJ'
elif pos_tag in adverb:
return 'RB'
elif pos_tag in verb:
return 'VB'
elif pos_tag in wh:
return 'WP'
else:
return pos_tag
PreLabelWithPosPreprocessor.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录