Skip to content

對話樹

標註層次化對話結構,支援節點評分和路徑選擇。

對話樹標註方案支援標註層次化對話結構,例如聊天機器人回覆樹、對話系統或分支敘事。標註者可以對單個節點進行評分、選擇首選路徑以及比較決策點處的分支。

使用場景

  • 聊天機器人評估 - 對多個回覆選項的品質進行評分
  • 對話系統 - 選擇首選的對話路徑
  • A/B 測試 - 比較不同的回覆策略
  • 互動小說 - 評估分支故事路徑

快速入門

yaml
annotation_schemes:
  - annotation_type: tree_annotation
    name: response_quality
    description: Evaluate the conversation tree
    node_scheme:
      annotation_type: likert
      min_label: "Poor"
      max_label: "Excellent"
      size: 5
    path_selection:
      enabled: true
      description: Select the best response path through the tree

配置選項

欄位類型預設值描述
annotation_typestring必填必須為 "tree_annotation"
namestring必填此方案的唯一識別符號
descriptionstring必填顯示給標註者的說明
node_schemeobject{}逐節點標註的標註方案配置
path_selection.enabledbooleanfalse啟用通過樹的路徑選擇
path_selection.descriptionstring"Select the best response path"路徑選擇的說明
branch_comparison.enabledbooleanfalse啟用分支比較模式

示例

節點評分

對對話樹中的每個回覆進行評分:

yaml
annotation_schemes:
  - annotation_type: tree_annotation
    name: response_rating
    description: Rate each response in the conversation
    node_scheme:
      annotation_type: likert
      min_label: "Very Bad"
      max_label: "Very Good"
      size: 5

路徑選擇

選擇對話中的最佳路徑:

yaml
annotation_schemes:
  - annotation_type: tree_annotation
    name: best_path
    description: Navigate the conversation tree
    path_selection:
      enabled: true
      description: Click on responses to build the best conversation path

多維度節點評分

從多個維度對節點進行評分:

yaml
annotation_schemes:
  - annotation_type: tree_annotation
    name: multi_criteria
    description: Evaluate each response on multiple criteria
    node_scheme:
      annotation_type: multirate
      options:
        - Relevance
        - Fluency
        - Helpfulness
      labels: ["1", "2", "3", "4", "5"]

分支比較模式

在決策點比較同級分支:

yaml
annotation_schemes:
  - annotation_type: tree_annotation
    name: branch_compare
    description: Compare response options at each decision point
    branch_comparison:
      enabled: true
    node_scheme:
      annotation_type: radio
      labels: ["Better", "Same", "Worse"]

資料格式

輸入

樹資料應以層次化結構的 JSON 格式提供:

json
{
  "id": "conv_001",
  "tree": {
    "id": "root",
    "role": "user",
    "content": "Hello, I need help with my order",
    "children": [
      {
        "id": "resp_a",
        "role": "assistant",
        "content": "I'd be happy to help! Can you provide your order number?",
        "children": [
          {
            "id": "user_2",
            "role": "user",
            "content": "It's ORDER-12345",
            "children": []
          }
        ]
      },
      {
        "id": "resp_b",
        "role": "assistant",
        "content": "Sure, what seems to be the problem?",
        "children": []
      }
    ]
  }
}

配置樹資料鍵:

yaml
item_properties:
  id_key: id
  tree_key: tree

輸出

樹標註同時儲存節點級和路徑級資料:

json
{
  "response_quality": {
    "node_annotations": {
      "resp_a": {
        "rating": 4
      },
      "resp_b": {
        "rating": 2
      }
    },
    "selected_path": ["root", "resp_a", "user_2"]
  }
}

使用者介面

樹形視覺化

對話樹以節點表示訊息/回覆,邊連線父子關係,分支點表示存在多個回覆的位置。

節點選擇

點選任何節點可檢視完整訊息內容、訪問標註面板,以及將節點新增到選定路徑(如果啟用了路徑選擇)。

路徑選擇

啟用路徑選擇時,點選節點將其新增到路徑中。選定的路徑會高亮顯示,您可以使用"清除路徑"重新開始。

最佳實踐

  1. 保持節點方案簡單 - 每個節點上覆雜的標註介面會減慢標註速度
  2. 提供上下文 - 確保標註者在評分回覆時能看到父訊息
  3. 明智地使用路徑選擇 - 最適合較小的樹
  4. 培訓標註者 - 樹形導航需要練習;提供培訓示例

延伸閱讀

有關實現細節,請參閱源文件