文本與數字輸入
用於標註的自由文本和數字輸入。
文本和數字輸入允許標註者提供自由形式的回覆,適用於修正、解釋、計數和測量。
文本輸入
基本文本欄位
單行文本輸入:
yaml
annotation_schemes:
- annotation_type: text
name: correction
description: "Provide a corrected version of the text"多行文本區域
用於較長的回覆:
yaml
- annotation_type: text
name: explanation
description: "Explain your reasoning"
rows: 4佔位文本
用示例輸入引導標註者:
yaml
- annotation_type: text
name: summary
description: "Write a one-sentence summary"
placeholder: "Enter your summary here..."字元限制
約束回覆長度:
yaml
- annotation_type: text
name: title
description: "Suggest a title"必填文本
設為必填欄位:
yaml
- annotation_type: text
name: justification
description: "Why did you choose this label?"
label_requirement:
required: true數字輸入
帶有最小值和最大值約束的數字輸入欄位
基本數字欄位
yaml
annotation_schemes:
- annotation_type: number
name: count
description: "How many entities are mentioned?"範圍約束
設定最小和最大值:
yaml
- annotation_type: number
name: rating
description: "Rate from 1 to 10"
min: 1
max: 10步長
控制增量精度:
yaml
- annotation_type: number
name: percentage
description: "What percentage is relevant?"
min: 0
max: 100
step: 5 # Increments of 5小數
允許浮點值:
yaml
- annotation_type: number
name: score
description: "Confidence score"
min: 0.0
max: 1.0
step: 0.1預設值
預填預設值:
yaml
- annotation_type: number
name: count
description: "Number of errors"
min: 0滑塊輸入
數字輸入的視覺替代:
yaml
- annotation_type: slider
name: confidence
description: "How confident are you?"
min_value: 0
max_value: 100
step: 1帶標籤的滑塊
新增端點標籤:
yaml
- annotation_type: slider
name: agreement
description: "How much do you agree?"
min_value: 0
max_value: 100滑塊顯示選項
顯示當前值:
yaml
- annotation_type: slider
name: rating
min_value: 0
max_value: 100常見使用場景
文本修正任務
yaml
annotation_schemes:
- annotation_type: radio
name: has_error
description: "Does this text contain errors?"
labels:
- "Yes"
- "No"
- annotation_type: text
name: corrected_text
description: "Provide the corrected version"
rows: 4翻譯品質
yaml
annotation_schemes:
- annotation_type: slider
name: adequacy
description: "How much meaning is preserved?"
min_value: 0
max_value: 100
- annotation_type: slider
name: fluency
description: "How natural does it sound?"
min_value: 0
max_value: 100
- annotation_type: text
name: improved_translation
description: "Suggest a better translation (optional)"
rows: 4
label_requirement:
required: false實體計數
yaml
annotation_schemes:
- annotation_type: number
name: person_count
description: "How many people are mentioned?"
min: 0
max: 50
- annotation_type: number
name: org_count
description: "How many organizations are mentioned?"
min: 0
max: 50
- annotation_type: number
name: location_count
description: "How many locations are mentioned?"
min: 0
max: 50反饋收集
yaml
annotation_schemes:
- annotation_type: likert
name: difficulty
description: "How difficult was this task?"
size: 5
min_label: "Very Easy"
max_label: "Very Hard"
- annotation_type: text
name: feedback
description: "Any additional feedback?"
rows: 4
label_requirement:
required: false
placeholder: "Share your thoughts..."帶理由的品質評估
yaml
annotation_schemes:
- annotation_type: radio
name: quality
description: "Rate the quality"
labels:
- Excellent
- Good
- Fair
- Poor
- annotation_type: text
name: justification
description: "Explain your rating"
rows: 4
label_requirement:
required: true驗證
文本驗證
yaml
- annotation_type: text
name: email
description: "Enter contact email"數字驗證
數字會自動根據最小/最大值進行驗證:
yaml
- annotation_type: number
name: year
description: "Enter the year"
min: 1900
max: 2024鍵盤導航
文本和數字欄位支援標準鍵盤導航:
Tab在欄位之間移動Enter提交(單行文本)- 方向鍵用於數字增減
輸出格式
文本和數字標註直接儲存:
json
{
"id": "doc1",
"correction": "The corrected text goes here.",
"count": 5,
"confidence": 85
}完整示例:文件審查
yaml
task_name: "Document Review"
annotation_schemes:
# Quality rating
- annotation_type: likert
name: quality
description: "Overall document quality"
size: 5
min_label: "Poor"
max_label: "Excellent"
# Error count
- annotation_type: number
name: error_count
description: "Number of errors found"
min: 0
max: 100
# Confidence slider
- annotation_type: slider
name: confidence
description: "How confident are you in this assessment?"
min_value: 0
max_value: 100
# Detailed feedback
- annotation_type: text
name: errors_found
description: "List the errors you found"
rows: 4
placeholder: "Describe each error..."
# Summary
- annotation_type: text
name: summary
description: "Brief summary of the document"
placeholder: "Summarize in one sentence..."最佳實踐
- 使用合適的輸入類型 - 連續值用滑塊,精確計數用數字
- 設定合理的約束 - 最小/最大值防止無效資料
- 提供佔位文本 - 引導標註者瞭解預期格式
- 明確可選欄位 - 使用
required: false並在描述中說明 - 使用條件顯示 - 僅在需要時顯示文本欄位
- 考慮驗證 - 對郵箱或 ID 等結構化輸入使用模式匹配