共指链
将指代同一实体的文本片段分组,用于共指消解任务。
共指链
共指标注允许标注者将指代同一实体的文本片段分组。这对实体消解、代词消解和语篇分析至关重要。
概述
共指链是指代同一现实世界实体的一组提及(文本片段)。例如:
"居里夫人是一位物理学家。她获得了诺贝尔奖。这位科学家永远改变了她的领域。"
"居里夫人"、"她"、"这位科学家"和"她的"都指代同一个人,形成一条共指链。
快速入门
共指标注需要两个方案组件:
- 用于创建提及的片段方案
- 用于将提及分组到链中的共指方案
yaml
annotation_schemes:
- annotation_type: span
name: mentions
description: Highlight all entity mentions
labels:
- name: MENTION
tooltip: "Any reference to an entity"
sequential_key_binding: true
- annotation_type: coreference
name: coref_chains
description: Group mentions that refer to the same entity
span_schema: mentions
allow_singletons: true配置选项
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
annotation_type | string | 必填 | 必须为 "coreference" |
name | string | 必填 | 此方案的唯一标识符 |
description | string | 必填 | 显示给标注者的说明 |
span_schema | string | 必填 | 提供提及的片段方案名称 |
entity_types | list | [] | 实体类型类别列表 |
allow_singletons | boolean | true | 允许仅包含一个提及的链 |
visual_display.highlight_mode | string | "background" | 视觉样式:"background"、"bracket" 或 "underline" |
示例
带实体类型
按实体类型对链进行分类:
yaml
annotation_schemes:
- annotation_type: span
name: ner
description: Mark named entities
labels:
- name: ENTITY
tooltip: "Any named entity mention"
- annotation_type: coreference
name: coref
description: Create coreference chains
span_schema: ner
entity_types:
- name: PERSON
color: "#6E56CF"
- name: ORGANIZATION
color: "#22C55E"
- name: LOCATION
color: "#3B82F6"
- name: OTHER
color: "#F59E0B"不允许单例
对于每个提及必须至少与另一个提及链接的任务:
yaml
annotation_schemes:
- annotation_type: span
name: mentions
description: Highlight co-referring mentions
labels:
- name: MENTION
- annotation_type: coreference
name: strict_coref
description: All mentions must be part of a chain with at least 2 mentions
span_schema: mentions
allow_singletons: false自定义视觉显示
yaml
annotation_schemes:
- annotation_type: coreference
name: coref
description: Link coreference chains
span_schema: mentions
visual_display:
highlight_mode: "underline" # Options: background, bracket, underline用户界面
创建链
- 创建提及:使用片段标注工具高亮所有实体提及
- 选择提及:点击您想要链接在一起的高亮片段
- 创建链:点击"新建链"将选中的提及分组
管理链
- 添加到链:选择额外的提及并点击"添加到链"
- 合并链:选择多条链并点击"合并链"来组合它们
- 移除提及:选择一个提及并点击"移除提及"将其从链中移除
颜色编码
每条链自动分配一种独特的颜色。同一链中的提及共享相同的颜色,便于直观地识别链的成员关系。
输出格式
共指标注作为片段链接保存:
json
{
"span_links": [
{
"schema": "coref_chains",
"link_type": "coreference",
"span_ids": ["mentions_0_5_MENTION", "mentions_34_37_MENTION", "mentions_72_85_MENTION"],
"entity_type": "PERSON"
},
{
"schema": "coref_chains",
"link_type": "coreference",
"span_ids": ["mentions_15_23_MENTION", "mentions_95_97_MENTION"],
"entity_type": "ORGANIZATION"
}
]
}推荐工作流程
- 第一遍 - 通读文本并高亮所有实体提及
- 第二遍 - 将提及分组到共指链中
- 审查 - 检查所有提及是否正确分配,是否遗漏任何链
最佳实践
- 定义清晰的提及边界 - 建立什么算作提及的指导方针
- 处理嵌套提及 - 决定如何处理"微软的CEO"等情况
- 考虑泛指 - 确定是否应包含泛指引用
- 培训标注者 - 共指是复杂的;提供示例和练习轮次
- 谨慎使用实体类型 - 过多可能会减慢标注速度而不提高数据质量
延伸阅读
有关实现细节,请参阅源文档。