標註方案
定義標註者將如何標註您的資料。
標註方案定義了標註者的標註任務。Potato 支援 30 多種標註類型,可以組合建立複雜的標註任務。
標註方案剖析
基本結構
每個方案在 annotation_schemes 陣列中定義:
yaml
annotation_schemes:
- annotation_type: radio
name: sentiment
description: "What is the sentiment?"
labels:
- Positive
- Negative
- Neutral必填欄位
| 欄位 | 描述 |
|---|---|
annotation_type | 標註類型(radio、multiselect、likert、span、text、number、slider、multirate) |
name | 內部識別符號(無空格,用於輸出) |
description | 顯示給標註者的說明 |
支援的標註類型
1. 單選(Radio)
從列表中選擇一個選項:
yaml
- annotation_type: radio
name: sentiment
description: "What is the sentiment of this text?"
labels:
- Positive
- Negative
- Neutral
# Optional features
sequential_key_binding:
Positive: "1"
Negative: "2"
Neutral: "3"
# Or use sequential binding (1, 2, 3... automatically)
sequential_key_binding: true
# Horizontal layout instead of vertical
horizontal: true2. 李克特量表(Likert Scale)
帶有端點標籤的評分量表:
yaml
- annotation_type: likert
name: agreement
description: "How much do you agree with this statement?"
size: 5 # Number of scale points
min_label: "Strongly Disagree"
max_label: "Strongly Agree"
# Optional mid-point label
# Show numeric values3. 多選(Multiselect)
從列表中選擇多個選項:
yaml
- annotation_type: multiselect
name: topics
description: "Select all relevant topics"
labels:
- Politics
- Technology
- Sports
- Entertainment
- Science
# Selection constraints
# Allow free text response
has_free_response: true4. 片段標註(Span Annotation)
高亮並標記文本片段:
yaml
- annotation_type: span
name: entities
description: "Highlight named entities in the text"
labels:
- PERSON
- ORGANIZATION
- LOCATION
- DATE
# Visual customization
# Allow overlapping spans
allow_discontinuous: false
# Keyboard shortcuts for labels
sequential_key_binding: true5. 滑塊(Slider)
連續數值範圍:
yaml
- annotation_type: slider
name: confidence
description: "How confident are you in your answer?"
min_value: 0
max_value: 100
step: 1
# Endpoint labels
# Show current value6. 文本輸入(Text Input)
自由文本回復:
yaml
- annotation_type: text
name: explanation
description: "Explain your reasoning"
# Multi-line input
rows: 4
# Character limits
# Placeholder text
placeholder: "Enter your explanation here..."
# Disable paste (for transcription tasks)7. 數字輸入(Number Input)
帶約束的數字輸入:
yaml
- annotation_type: number
name: count
description: "How many entities are mentioned?"
min: 0
max: 100
step: 18. 多項評分(Multirate)
在同一量表上對多個項目進行評分:
yaml
- annotation_type: multirate
name: quality_aspects
description: "Rate each aspect of the response"
# Randomize item order
# Layout options通用選項
鍵盤快捷鍵
通過鍵盤繫結加速標註:
yaml
# Manual shortcuts
keyboard_shortcuts:
Positive: "1"
Negative: "2"
Neutral: "3"
# Or automatic sequential binding
sequential_key_binding: true # Assigns 1, 2, 3...工具提示
為標籤提供懸停提示:
yaml
tooltips:
Positive: "Expresses happiness, approval, or satisfaction"
Negative: "Expresses sadness, anger, or disappointment"
Neutral: "No clear emotional content"標籤顏色
自定義顏色以進行視覺區分:
yaml
label_colors:
PERSON: "#3b82f6"
LOCATION: "#10b981"
ORGANIZATION: "#f59e0b"必填欄位
在提交前使方案成為必填項:
yaml
- annotation_type: radio
name: sentiment
label_requirement:
required: true
labels:
- Positive
- Negative多方案組合
每個實例組合多種標註類型:
yaml
annotation_schemes:
# Primary classification
- annotation_type: radio
name: sentiment
description: "Overall sentiment"
labels:
- Positive
- Negative
- Neutral
label_requirement:
required: true
sequential_key_binding: true
# Confidence rating
- annotation_type: likert
name: confidence
description: "How confident are you?"
size: 5
min_label: "Guessing"
max_label: "Certain"
# Topic tags
- annotation_type: multiselect
name: topics
description: "Select all relevant topics"
labels:
- Politics
- Technology
- Sports
- Entertainment
has_free_response: true
# Notes
- annotation_type: text
name: notes
description: "Any additional observations?"
rows: 4
label_requirement:
required: false高階功能
成對比較
比較兩個項目:
yaml
- annotation_type: pairwise
name: preference
description: "Which response is better?"
labels:
- label: "Response A"
value: "A"
- label: "Response B"
value: "B"
- label: "Equal"
value: "tie"
# Allow tie selection
allow_tie: true最佳-最差縮放
通過選擇最佳和最差來排列項目:
yaml
- annotation_type: bws
name: ranking
description: "Select the best and worst items"
# Items come from the data file下拉選擇
節省空間的單選:
yaml
- annotation_type: select
name: category
description: "Select a category"
labels:
- Category A
- Category B
- Category C
- Category D
- Category E
# Default selection資料格式參考
輸入
標註方案與您的資料格式配合使用:
json
{
"id": "doc_1",
"text": "This is the text to annotate."
}輸出
標註以方案名稱為鍵儲存:
json
{
"id": "doc_1",
"annotations": {
"sentiment": "Positive",
"confidence": 4,
"topics": ["Technology", "Science"],
"entities": [
{"start": 0, "end": 4, "label": "ORGANIZATION", "text": "This"}
],
"notes": "Clear positive sentiment about technology."
}
}最佳實踐
1. 清晰的標籤
使用明確、有區分度的標籤:
yaml
# Good
labels:
- Strongly Positive
- Somewhat Positive
- Neutral
- Somewhat Negative
- Strongly Negative
# Avoid
labels:
- Good
- OK
- Fine
- Acceptable2. 有用的工具提示
為有細微差別的標籤新增工具提示:
yaml
tooltips:
Sarcasm: "The text says the opposite of what it means"
Irony: "A mismatch between expectation and reality"3. 鍵盤快捷鍵
為大批次任務啟用快捷鍵:
yaml
sequential_key_binding: true4. 邏輯順序
始終如一地排列標籤:
- 最常見的放在首位
- 按字母順序排列
- 按強度排列(從低到高)
5. 限制選項數量
過多的選擇會減慢標註速度:
- 單選:2-7 個選項
- 多選:5-15 個選項
- 李克特量表:5-7 個等級
6. 先行測試
在部署之前自己標註幾個示例,以發現:
- 含糊的標籤
- 遺漏的類別
- 不清晰的說明