python nltk 命名实体_python-3.x - 使用NLTK命名实体识别:提取审核员名称,地址和组织 - SO中文参考 - www.soinside.com...

我正在尝试使用nltk从句子中识别人物,组织和地点。

我的用例是从年度财务报告中提取审计员名称,组织和地点

使用python中的nltk,结果似乎并不令人满意

import nltk

from nltk.tokenize import word_tokenize

from nltk.tag import pos_tag

ex='Alastair John Richard Nuttall (Senior statutory auditor) for and on behalf of Ernst & Young LLP (Statutory auditor) Leeds'

ne_tree = ne_chunk(pos_tag(word_tokenize(ex)))

print(ne_tree)

Tree('S', [Tree('PERSON', [('Alastair', 'NNP')]), Tree('PERSON', [('John', 'NNP'), ('Richard', 'NNP'), ('Nuttall', 'NNP')]), ('(', '('), Tree('ORGANIZATION', [('Senior', 'NNP')]), ('statutory', 'NNP'), ('auditor', 'NN'), (')', ')'), ('for', 'IN'), ('and', 'CC'), ('on', 'IN'), ('behalf', 'NN'), ('of', 'IN'), Tree('GPE', [('Ernst', 'NNP')]), ('&', 'CC'), Tree('PERSON', [('Young', 'NNP'), ('LLP', 'NNP')]), ('(', '('), ('Statutory', 'NNP'), ('auditor', 'NN'), (')', ')'), ('Leeds', 'NNS')])

如上所述,“利兹”未被确定为地点,安永会计师事务所也未被认定为组织

有没有更好的方法在Python中实现这一目标?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值