我正在使用 Polyglot 从文件中获取组织、位置和人员。并非所有匹配都是正确的,那么有没有办法获得标签匹配的信心?
import polyglot
import codecs
from polyglot.text import Text, Word
import sys
text = Text(sys.argv[1])
for sent in text.sentences:
for entity in sent.entities:
if entity.tag == 'I-ORG':
# check tag confidence
# some code...
elif entity.tag == 'I-LOC':
# check tag confidence
# some code...
elif entity.tag == 'I-PER':
# check tag confidence
# some code...