Skip to content

錯誤片段

在 Potato 中搭建 MQM 風格的錯誤標註介面,用於翻譯品質評估、文本糾錯,以及帶嚴重程度打分的分類錯誤片段標註。

錯誤片段標註方案提供 MQM 風格(Multidimensional Quality Metrics,多維品質指標)的介面,用帶類別和嚴重程度的方式標出文本中的錯誤。它適合翻譯品質評估、文本編輯審校、內容品質檢查,以及任何需要細粒度錯誤標註的任務。

Potato error span interface for marking translation errors with severity scoresError span in Potato

概覽

錯誤片段方案提供:

  • 分類的錯誤類型,可選配子類型做更細的劃分
  • 嚴重程度等級,每一級的扣分可配置
  • 即時品質分,隨著標出的錯誤增加而下降
  • 顏色編碼的片段,在視覺上區分錯誤類型和嚴重程度

標註者選中一段文本,指定錯誤類型和嚴重程度,系統自動算出品質分。

快速開始

yaml
annotation_schemes:
  - annotation_type: error_span
    name: translation_errors
    description: Mark all errors in the translation below.
    error_types:
      - name: Accuracy
      - name: Fluency
      - name: Terminology
    show_score: true
    max_score: 100

配置項

欄位類型預設值說明
annotation_typestring必填必須為 "error_span"
namestring必填本方案的唯一識別符號
descriptionstring必填展示給標註者的說明文字
error_typesarray必填錯誤類型物件列表,每項包含 name 和可選的 subtypes 陣列
severitiesarray[{name: "Minor", weight: -1}, {name: "Major", weight: -5}, {name: "Critical", weight: -10}]嚴重程度列表,每項包含 nameweight(扣分值)
show_scorebooleantrue是否顯示即時品質分
max_scoreinteger100扣分之前的初始品質分

示例

翻譯品質(MQM)

yaml
annotation_schemes:
  - annotation_type: error_span
    name: mqm_errors
    description: >
      Mark all errors in the machine translation.
      Select the error span, choose a category and severity.
    error_types:
      - name: Accuracy
        subtypes:
          - Mistranslation
          - Addition
          - Omission
          - Untranslated
      - name: Fluency
        subtypes:
          - Grammar
          - Spelling
          - Punctuation
          - Register
      - name: Terminology
        subtypes:
          - Inconsistent
          - Wrong Term
      - name: Style
    severities:
      - name: Minor
        weight: -1
      - name: Major
        weight: -5
      - name: Critical
        weight: -10
    show_score: true
    max_score: 100

內容編輯審校

yaml
annotation_schemes:
  - annotation_type: error_span
    name: editing_errors
    description: Mark all issues that need editing in this article.
    error_types:
      - name: Factual Error
      - name: Grammar
        subtypes:
          - Subject-Verb Agreement
          - Tense
          - Pronoun Reference
      - name: Style
        subtypes:
          - Wordiness
          - Passive Voice
          - Jargon
      - name: Formatting
    severities:
      - name: Suggestion
        weight: -1
      - name: Required Fix
        weight: -5
    show_score: false

程式碼評審標註

yaml
annotation_schemes:
  - annotation_type: error_span
    name: code_errors
    description: Mark issues in this code snippet.
    error_types:
      - name: Bug
        subtypes:
          - Logic Error
          - Off-by-One
          - Null Reference
      - name: Style
        subtypes:
          - Naming
          - Formatting
      - name: Security
        subtypes:
          - Injection
          - Exposure
      - name: Performance
    severities:
      - name: Nitpick
        weight: -1
      - name: Warning
        weight: -3
      - name: Blocker
        weight: -10
    max_score: 100
    show_score: true

輸出格式

json
{
  "translation_errors": {
    "labels": {
      "errors": [
        {
          "start": 12,
          "end": 25,
          "text": "incorrectly translated",
          "error_type": "Accuracy",
          "subtype": "Mistranslation",
          "severity": "Major"
        },
        {
          "start": 45,
          "end": 52,
          "text": "the the",
          "error_type": "Fluency",
          "subtype": "Grammar",
          "severity": "Minor"
        }
      ],
      "score": 94
    }
  }
}

分數等於 max_score 加上所有嚴重程度權重之和。

實踐建議

  1. 把錯誤類型的邊界劃清楚 —— 標註者不應該在兩個類型之間反覆糾結;在說明文字裡給出例子
  2. 用子類型做細分 —— 頂層類型保持介面簡潔,需要細緻分析時再看子類型
  3. 認真校準嚴重程度權重 —— 權重比例要反映實際影響,嚴重錯誤的代價應該明顯高於輕微錯誤
  4. 根據文本長度設定 max_score —— 文本較短時,把 max_score 調低,避免單個錯誤影響過大
  5. 提供標註指南 —— MQM 風格的標註很依賴詳細指南,每種錯誤類型和嚴重程度都要配例子

延伸閱讀

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