赞
踩
pip install pyhanlp
from pyhanlp import HanLP
arr = ['你好', '陈婷', '章子怡']
for text in arr:
segment = HanLP.newSegment().enableNameRecognize(True); # 构建人名识别器
result = segment.seg(text) # 对text文本进行人名识别
print(result) # 输出结果
'''
[你好/vl]
[陈婷/nr]
[章子怡/nr]
'''
地名识别
enablePlaceRecognize
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。