软标签
在 Potato 中配置软标签标注,用滑块把固定总分分配到各个类别上,从而得到一个概率分布。
软标签标注方案让标注者在多个类别之间分配一个概率分布,而不是做单一的硬分类决定。标注者用滑块把固定的总量(例如 100 分)分配到各个标签上,从而表达出不确定性或类别之间的重叠程度。
Potato 中的软标签
概述
当一个条目可能部分属于多个类别时,软标签很有用。这个方案不强迫标注者只选一个标签,而是让他们在所有选项上表达相对的把握程度。滑块之间是联动的,总和始终等于配置的总分,还可以开启一张分布图提供直观反馈。
快速上手
yaml
annotation_schemes:
- annotation_type: soft_label
name: sentiment_distribution
description: Distribute 100 points across sentiment categories based on how much each applies.
labels: ["Positive", "Neutral", "Negative"]
total: 100配置项
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
annotation_type | string | 必填 | 必须是 "soft_label" |
name | string | 必填 | 该方案的唯一标识 |
description | string | 必填 | 展示给标注者的说明文字 |
labels | array | 必填 | 类别标签列表(至少 2 个) |
total | integer | 100 | 所有滑块必须加总到的固定值 |
min_per_label | integer | 0 | 每个标签至少要分到的值 |
show_distribution_chart | boolean | true | 显示饼图或柱状图展示当前分布 |
label_requirement.required | boolean | false | 是否必须完成该标注才能进入下一条 |
示例
情感分布
yaml
annotation_schemes:
- annotation_type: soft_label
name: sentiment_distribution
description: How much does each sentiment apply to this text?
labels: ["Positive", "Neutral", "Negative"]
total: 100
show_distribution_chart: true情绪强度
yaml
annotation_schemes:
- annotation_type: soft_label
name: emotion_mix
description: Distribute points to reflect the mix of emotions in this utterance.
labels: ["Joy", "Sadness", "Anger", "Fear", "Surprise", "Disgust"]
total: 100
min_per_label: 0
show_distribution_chart: true主题相关性
yaml
annotation_schemes:
- annotation_type: soft_label
name: topic_relevance
description: How relevant is this document to each topic?
labels: ["Politics", "Sports", "Technology", "Entertainment"]
total: 100强制最低分配
yaml
annotation_schemes:
- annotation_type: soft_label
name: genre_mix
description: Allocate points across genres. Each genre must receive at least 5 points.
labels: ["Rock", "Pop", "Jazz", "Classical", "Electronic"]
total: 100
min_per_label: 5输出格式
json
{
"sentiment_distribution": {
"labels": {
"Positive": 45,
"Neutral": 30,
"Negative": 25
}
}
}各项数值的总和始终等于配置的 total。
实践建议
- 类别有重叠时再用 —— 当条目确实以不同程度同时属于多个类别时,软标签最合适
- 标签数量别太多 —— 超过 6 到 7 个标签,滑块界面就不好用了
- 总分要选得有意义 —— 100 当作百分比最直观,简单任务用更小的总分也可以
min_per_label慎用 —— 某个标签本来就不适用时,强制最低分配会让结果产生偏差- 打开分布图 —— 直观反馈能让标注者一眼看清自己分配得怎么样
延伸阅读
有关实现详情,请参阅源文档。