Skip to content
Guides2 min read

自動キーワードハイライト

AI搭載のキーワードハイライトを設定して、アノテーターの注意を重要な用語やフレーズに向ける方法。

Potato Team·

自動キーワードハイライト

AI搭載のキーワードハイライトは、テキスト内の重要な用語、エンティティ、パターンにアノテーターの注意を向けます。このガイドでは、PotatoのAIサポートを設定して関連キーワードを自動的にハイライトする方法を説明します。

なぜキーワードハイライトを使うのか?

  • 注意の集中:関連コンテンツにアノテーターを導く
  • 速度の向上:重要な情報の迅速な識別
  • エラーの削減:重要な用語を見落とす可能性を低減
  • AIの活用:LLMにコンテキスト固有のキーワードを特定させる

基本的なAI搭載ハイライト

PotatoはAIサポートシステムを使用して重要なキーワードを識別しハイライトします。基本的な設定:

yaml
annotation_task_name: "Keyword Highlighted Annotation"
 
data_files:
  - path: "data/reviews.json"
    format: json
 
item_properties:
  id_key: id
  text_key: text
 
annotation_schemes:
  - annotation_type: radio
    name: sentiment
    description: "What is the overall sentiment?"
    labels:
      - Positive
      - Negative
      - Neutral
 
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
    temperature: 0.3
    max_tokens: 500
 
  features:
    keyword_highlighting:
      enabled: true
      # Highlights are rendered as box overlays on the text

異なるAIプロバイダーの使用

OpenAI

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4o
    api_key: ${OPENAI_API_KEY}
    temperature: 0.3
    max_tokens: 500
 
  features:
    keyword_highlighting:
      enabled: true
 

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
 
  features:
    keyword_highlighting:
      enabled: true
      # Highlights are rendered as box overlays on the text

ローカルOllama(APIコストなし)

yaml
ai_support:
  enabled: true
  endpoint_type: ollama
 
  ai_config:
    model: llama2
    base_url: http://localhost:11434
 
  features:
    keyword_highlighting:
      enabled: true
      # Highlights are rendered as box overlays on the text

機能の組み合わせ

AIサポートは複数の機能を組み合わせて効果的に使用できます:

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
    temperature: 0.3
    max_tokens: 500
 
  features:
    # Highlight important keywords
    keyword_highlighting:
      enabled: true
      # Highlights are rendered as box overlays on the text
 
    # Show contextual hints
    hints:
      enabled: true
 
    # Suggest labels for consideration
    label_suggestions:
      enabled: true
      show_confidence: true

完全な設定例

エンティティ認識型AIハイライト付きアノテーションの完全な設定:

yaml
annotation_task_name: "Entity-Aware Annotation"
 
data_files:
  - path: "data/documents.json"
    format: json
 
item_properties:
  id_key: id
  text_key: text
 
annotation_schemes:
  - annotation_type: span
    name: entities
    labels:
      - name: PERSON
        color: "#FECACA"
      - name: ORG
        color: "#BBF7D0"
      - name: LOCATION
        color: "#BFDBFE"
 
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
    temperature: 0.3
    max_tokens: 500
 
  features:
    keyword_highlighting:
      enabled: true
      # Highlights are rendered as box overlays on the text
    hints:
      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: 3
      on_prev: 2
 
output_annotation_dir: "output/"
output_annotation_format: json
allow_all_users: true

パフォーマンスのためのキャッシング

キャッシングを有効にしてAPIコールを減らし、応答時間を改善:

yaml
ai_support:
  enabled: true
  endpoint_type: openai
 
  ai_config:
    model: gpt-4
    api_key: ${OPENAI_API_KEY}
 
  features:
    keyword_highlighting:
      enabled: true
 
  cache_config:
    disk_cache:
      enabled: true
      path: "ai_cache/cache.json"
 
    # Pre-generate highlights on startup and prefetch upcoming
    prefetch:
      warm_up_page_count: 100
      on_next: 5
      on_prev: 2

ヒント

  1. タスクに合った色を選択:アノテーションスキームを補完するハイライト色を使用
  2. キャッシングを有効に:同じコンテンツへの繰り返しAPIコールを回避
  3. ローカルモデルを検討:APIコストなしで大量アノテーションにOllamaを使用
  4. 機能を組み合わせ:キーワードハイライトはヒントやラベルサジェストとうまく連携

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