Skip to content

エラースパン

PotatoでMQM形式のエラーアノテーションインターフェースを構築します。翻訳品質の評価、テキスト中の誤りのマーキング、重大度スコア付きの類型化されたエラースパンのアノテーションに使えます。

エラースパンのアノテーションスキーマは、テキスト中の誤りに類型と重大度を付けてマークするための、MQM(Multidimensional Quality Metrics)形式のインターフェースを提供します。翻訳品質の評価、編集レビュー、コンテンツ品質の評価など、細かい粒度でのエラーアノテーションが必要なタスクに適しています。

重大度スコアを付けて翻訳エラーをマークするPotatoのエラースパンインターフェースError 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. 重大度の重みを丁寧に調整する - 重みの比率は実際の影響度を反映させてください。critical のエラーは minor より明確に大きな減点になるべきです
  4. テキストの長さに合わせてmax_scoreを設定する - 短いテキストではmax_scoreを下げておくと、1つのエラーの影響が過大になりません
  5. アノテーションガイドラインを用意する - MQM形式のアノテーションは、各エラー類型と重大度の例を載せた詳細なガイドラインがあるかどうかで結果が大きく変わります

参考資料

実装の詳細については、ソースドキュメントを参照してください。