Spacy 的 NER 中多词实体的 BILOU 标记方案
BILOU Tagging scheme for multi-word entities in Spacy's NER
我正在使用 spacy 构建自定义 NER,以识别 spacy 的 NER 之外的新实体。现在我可以使用 spacy.Example 标记和添加我的训练数据。我正在使用 BILOU 方案。我怀疑我有超过 3 个单词的实体。例如:
Housing Development Finance Corporation reported heavy losses in the past quarter.
我想使用 BILOU 方案将 Housing Development Finance Corporation 标记为单个实体。像
'Housing' B-Entity
'Development' I-Entity
'Finance' I-Entity
'Corporation' L-Entity
这个标记是否正确?模型将如何解释每个实体内的顺序?任何指导将不胜感激。
您的标记是正确的,所有非实体的外部单词都将标记为 O
。
模型将根据实体内的相同顺序将其与之前同名的实体相匹配,例如:
'Housing' B-Entity
'Development' I-Entity
'Finance' I-Entity
'Corporation' L-Entity
和
'Housing' B-Entity
'Finance' I-Entity
'Development' I-Entity
'Corporation' L-Entity
不会链接为同一个实体,但如果您希望这种情况发生,您可以查看分类模型,将您发现的实体分类为您以前已知的实体,然后从那里开始工作。
我正在使用 spacy 构建自定义 NER,以识别 spacy 的 NER 之外的新实体。现在我可以使用 spacy.Example 标记和添加我的训练数据。我正在使用 BILOU 方案。我怀疑我有超过 3 个单词的实体。例如:
Housing Development Finance Corporation reported heavy losses in the past quarter.
我想使用 BILOU 方案将 Housing Development Finance Corporation 标记为单个实体。像
'Housing' B-Entity
'Development' I-Entity
'Finance' I-Entity
'Corporation' L-Entity
这个标记是否正确?模型将如何解释每个实体内的顺序?任何指导将不胜感激。
您的标记是正确的,所有非实体的外部单词都将标记为 O
。
模型将根据实体内的相同顺序将其与之前同名的实体相匹配,例如:
'Housing' B-Entity
'Development' I-Entity
'Finance' I-Entity
'Corporation' L-Entity
和
'Housing' B-Entity
'Finance' I-Entity
'Development' I-Entity
'Corporation' L-Entity
不会链接为同一个实体,但如果您希望这种情况发生,您可以查看分类模型,将您发现的实体分类为您以前已知的实体,然后从那里开始工作。