ファイルから組織、場所、人を取得するために 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...