单个单词的多个NER标记

2024-10-01 00:24:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我成功地训练斯帕西识别一些自定义命名实体。在

假设这个模型成功地识别了公司(ORG)和水果(FRUIT)。在

我想得到一个词是每个实体的概率。比如:

doc = nlp("Apple to ship highest number of new iPhones this fall")

print(getProbabilities(doc))
// [
//   (0,0, 'Apple', [ ['ORG', 0.99], ['FRUIT', 0.01] ])
// ]

doc = nlp("Apple picking machine provides potential future of agriculture")

print(getProbabilities(doc))
// [
//   (0,0, 'Apple', [ ['FRUIT', 0.99], ['ORG', 0.01] ])
// ]

使用所描述的技术here我可以得到特定命名实体的分数,但只能得到最有可能的实体,而不是其他实体。在


Tags: oftoorg模型实体appledocnlp