Skip to content

區間滑塊

在 Potato 中配置雙滑塊區間標註,選取一段數值範圍,上下界、步長和端點標籤都可自定義。

區間滑塊標註方案提供一個雙滑塊控制元件,讓標註者選擇一段數值範圍而不是單個值。當答案本身是一個區間時它很合適,比如估計年齡段、時間視窗或置信區間。

Potato dual-thumb range slider set to an age range of 25 to 75Range slider in Potato

概覽

普通滑塊只能記錄一個值,區間滑塊則有兩個可拖動的滑塊,分別代表區間的下界和上界。標註者拖動任意一個滑塊來確定區間。當前數值會顯示在滑塊旁邊,方便精確調整。

快速開始

yaml
annotation_schemes:
  - annotation_type: range_slider
    name: age_range
    description: Estimate the age range of the author.
    min_value: 0
    max_value: 100
    step: 1
    left_label: "Young"
    right_label: "Old"

配置項

欄位類型預設值說明
annotation_typestring必填必須為 "range_slider"
namestring必填本方案的唯一識別符號
descriptionstring必填展示給標註者的說明文字
min_valuenumber0滑塊量表的最小值
max_valuenumber100滑塊量表的最大值
stepnumber1可選取數值之間的步長
left_labelstring顯示在滑塊左端(最小值)的標籤
right_labelstring顯示在滑塊右端(最大值)的標籤
show_valuesbooleantrue是否顯示當前選中的下界和上界數值
default_lownumber下界滑塊的預設位置
default_highnumber上界滑塊的預設位置
label_requirement.requiredbooleanfalse是否必須完成本項標註才能繼續

示例

年齡段估計

yaml
annotation_schemes:
  - annotation_type: range_slider
    name: age_estimate
    description: What age range do you think the author falls in?
    min_value: 13
    max_value: 90
    step: 1
    left_label: "Younger"
    right_label: "Older"

置信區間

yaml
annotation_schemes:
  - annotation_type: range_slider
    name: confidence_interval
    description: Select the range within which you believe the true value falls.
    min_value: 0
    max_value: 100
    step: 5
    left_label: "0%"
    right_label: "100%"
    show_values: true

時間視窗

yaml
annotation_schemes:
  - annotation_type: range_slider
    name: time_window
    description: When during the day is this activity most likely? (hours)
    min_value: 0
    max_value: 24
    step: 0.5
    left_label: "Midnight"
    right_label: "Midnight"

舒適溫度區間

yaml
annotation_schemes:
  - annotation_type: range_slider
    name: comfort_range
    description: What temperature range (°F) do you find comfortable?
    min_value: 40
    max_value: 110
    step: 1
    left_label: "Cold"
    right_label: "Hot"
    show_values: true

輸出格式

json
{
  "age_estimate": {
    "labels": {
      "low": 28,
      "high": 42
    }
  }
}

輸出裡總會有 lowhigh 兩個值,都落在配置的 min_valuemax_value 範圍內。

實踐建議

  1. 設好預設值 —— 用 default_lowdefault_high 避免所有標註者都從兩端極值開始
  2. 選合適的步長 —— 精細任務用小步長(0.1),粗略估計用大步長(5、10)
  3. 加上端點標籤 —— left_labelright_label 能給純數字補上語義背景
  4. 保持 show_values 開啟 —— 數值讀數能幫標註者選得更準
  5. 確實需要區間時才用 —— 如果只需要一個值,用普通的滑塊

延伸閱讀

有關實現詳情,請參閱源文件