Skip to content
Guides2 min read

LLMを活用したスマートアノテーションヒントの統合

OpenAI、Claude、またはGeminiを使用して、アノテーターにインテリジェントなヒントと提案を提供する方法を学びます。

Potato Team·

LLMを活用したスマートアノテーションヒントの統合

AI支援アノテーションは、速度と品質の両方を大幅に向上させることができます。本ガイドでは、OpenAI、Claude、Gemini、およびローカルモデルを統合して、アノテーターにインテリジェントな提案を提供する方法を紹介します。

LLM統合で可能になること

  • 事前アノテーション提案: AIがレビュー用の初期ラベルを提供
  • キーワードハイライト: 関連する用語を自動的にハイライト
  • 品質ヒント: アノテーションエラーの可能性をフラグ付け
  • 説明生成: アノテーターが難しいケースを理解するのを支援

基本的なOpenAI統合

yaml
annotation_task_name: "AI-Assisted Sentiment Analysis"
 
# AI configuration
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
    temperature: 0.3
    max_tokens: 500
 
  features:
    hints:
      enabled: true
    keyword_highlighting:
      enabled: true
    label_suggestions:
      enabled: true
 
# ... rest of config
annotation_schemes:
  - annotation_type: radio
    name: sentiment
    labels: [Positive, Negative, Neutral]

サポートされているプロバイダー

OpenAI

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4  # or gpt-4o, gpt-3.5-turbo
    api_key: ${OPENAI_API_KEY}
    temperature: 0.3
    max_tokens: 500

Anthropic Claude

yaml
ai_support:
  enabled: true
  endpoint_type: anthropic
 
  ai_config:
    model: claude-3-sonnet-20240229
    api_key: ${ANTHROPIC_API_KEY}
    temperature: 0.3
    max_tokens: 500

Google Gemini

yaml
ai_support:
  enabled: true
  endpoint_type: google
 
  ai_config:
    model: gemini-1.5-pro
    api_key: ${GOOGLE_API_KEY}

ローカルモデル(Ollama)

yaml
ai_support:
  enabled: true
  endpoint_type: ollama
 
  ai_config:
    model: llama2  # or mistral, mixtral, etc.
    base_url: http://localhost:11434

機能:ラベル提案

AIモデルはアノテーターが検討するためのラベルを提案できます:

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
 
  features:
    label_suggestions:
      enabled: true
      show_confidence: true
 
annotation_schemes:
  - annotation_type: radio
    name: category
    labels: [News, Opinion, Satire, Other]

機能:キーワードハイライト

重要な用語を自動的にハイライトします:

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
 
  features:
    keyword_highlighting:
      enabled: true

機能:インテリジェントヒント

アノテーターに文脈に応じたガイダンスを提供します:

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
 
  features:
    hints:
      enabled: true

ヒントは回答を明かさずに文脈的なガイダンスとして表示され、アノテーターが難しいケースを考え抜く手助けをします。

完全なAI支援設定

yaml
annotation_task_name: "AI-Assisted NER Annotation"
 
# AI Configuration
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
    temperature: 0.2
    max_tokens: 500
 
  features:
    hints:
      enabled: true
    keyword_highlighting:
      enabled: true
    label_suggestions:
      enabled: true
      show_confidence: true
 
  cache_config:
    disk_cache:
      enabled: true
      path: "ai_cache/cache.json"
    prefetch:
      warm_up_page_count: 50
      on_next: 5
      on_prev: 2
 
data_files:
  - data/texts.json
 
item_properties:
  id_key: id
  text_key: content
 
annotation_schemes:
  - annotation_type: span
    name: entities
    description: "Label named entities (AI suggestions provided)"
    labels:
      - name: PERSON
        color: "#FF6B6B"
      - name: ORG
        color: "#4ECDC4"
      - name: LOC
        color: "#45B7D1"
      - name: DATE
        color: "#96CEB4"
 
output_annotation_dir: "annotation_output/"
output_annotation_format: "json"

AI提案の活用

AIサポートが有効な場合、アノテーターはアノテーションインターフェースと並んで提案を確認できます。AIの推奨を承認、修正、または無視できます。最終的なアノテーションは常にアノテーターの判断を反映し、人間の監視を確保します。

キャッシュが有効な場合、AIの応答は自動的にキャッシュされるため、同じインスタンスで複数のAPI呼び出しが発生することはありません。

カスタムプロンプト

Potatoには各アノテーションタイプ用のデフォルトプロンプトが含まれており、potato/ai/prompt/に保存されています。プロンプトファイルを編集してカスタマイズできます:

アノテーションタイププロンプトファイル
ラジオボタンradio_prompt.txt
リッカートスケールlikert_prompt.txt
チェックボックスcheckbox_prompt.txt
スパンアノテーションspan_prompt.txt
テキスト入力text_prompt.txt

プロンプトは{text}{labels}{description}による変数置換をサポートしています。

AI支援アノテーションのコツ

  1. 控えめに始める: 最初はすべての提案をレビューする
  2. 承認率を監視する: 低い率はプロンプトの問題を示す
  3. プロンプトを改良する: よくあるエラーに基づいて改善する
  4. 人間の監視を維持する: AIは支援し、人間が判断する
  5. AIと人間のラベルを追跡する: 時間の経過とともにAIの精度を測定する

v2.2の新機能:オプションハイライト

Potato 2.2では、オプションハイライトと呼ばれる新しいAI機能が追加されました。コンテンツを分析して、離散的なアノテーションタスク(ラジオ、マルチセレクト、リッカート)で最も正しい可能性の高いオプションをハイライトします。上位k個のオプションはスターインジケーターでハイライトされ、可能性の低いオプションは薄く表示されますが、すべてのオプションはクリック可能なままです。

yaml
ai_support:
  option_highlighting:
    enabled: true
    top_k: 3
    dim_opacity: 0.4

オプションハイライトの完全なドキュメントを読む →

次のステップ


AIの完全なドキュメントは/docs/features/ai-supportをご覧ください。