LLMを活用したスマートアノテーションヒントの統合
OpenAI、Claude、またはGeminiを使用して、アノテーターにインテリジェントなヒントと提案を提供する方法を学びます。
LLMを活用したスマートアノテーションヒントの統合
AI支援アノテーションは、速度と品質の両方を大幅に向上させることができます。本ガイドでは、OpenAI、Claude、Gemini、およびローカルモデルを統合して、アノテーターにインテリジェントな提案を提供する方法を紹介します。
LLM統合で可能になること
- 事前アノテーション提案: AIがレビュー用の初期ラベルを提供
- キーワードハイライト: 関連する用語を自動的にハイライト
- 品質ヒント: アノテーションエラーの可能性をフラグ付け
- 説明生成: アノテーターが難しいケースを理解するのを支援
基本的なOpenAI統合
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
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: 500Anthropic Claude
ai_support:
enabled: true
endpoint_type: anthropic
ai_config:
model: claude-3-sonnet-20240229
api_key: ${ANTHROPIC_API_KEY}
temperature: 0.3
max_tokens: 500Google Gemini
ai_support:
enabled: true
endpoint_type: google
ai_config:
model: gemini-1.5-pro
api_key: ${GOOGLE_API_KEY}ローカルモデル(Ollama)
ai_support:
enabled: true
endpoint_type: ollama
ai_config:
model: llama2 # or mistral, mixtral, etc.
base_url: http://localhost:11434機能:ラベル提案
AIモデルはアノテーターが検討するためのラベルを提案できます:
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]機能:キーワードハイライト
重要な用語を自動的にハイライトします:
ai_support:
enabled: true
endpoint_type: openai
ai_config:
model: gpt-4
api_key: ${OPENAI_API_KEY}
features:
keyword_highlighting:
enabled: true機能:インテリジェントヒント
アノテーターに文脈に応じたガイダンスを提供します:
ai_support:
enabled: true
endpoint_type: openai
ai_config:
model: gpt-4
api_key: ${OPENAI_API_KEY}
features:
hints:
enabled: trueヒントは回答を明かさずに文脈的なガイダンスとして表示され、アノテーターが難しいケースを考え抜く手助けをします。
完全なAI支援設定
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支援アノテーションのコツ
- 控えめに始める: 最初はすべての提案をレビューする
- 承認率を監視する: 低い率はプロンプトの問題を示す
- プロンプトを改良する: よくあるエラーに基づいて改善する
- 人間の監視を維持する: AIは支援し、人間が判断する
- AIと人間のラベルを追跡する: 時間の経過とともにAIの精度を測定する
v2.2の新機能:オプションハイライト
Potato 2.2では、オプションハイライトと呼ばれる新しいAI機能が追加されました。コンテンツを分析して、離散的なアノテーションタスク(ラジオ、マルチセレクト、リッカート)で最も正しい可能性の高いオプションをハイライトします。上位k個のオプションはスターインジケーターでハイライトされ、可能性の低いオプションは薄く表示されますが、すべてのオプションはクリック可能なままです。
ai_support:
option_highlighting:
enabled: true
top_k: 3
dim_opacity: 0.4次のステップ
- アクティブラーニングを有効にして不確実なアイテムを優先する
- AIメトリクスを使用した品質管理を設定する
- プライバシーのためのローカルモデルについて学ぶ
- ガイド付きアノテーションのためのオプションハイライトを探索する
AIの完全なドキュメントは/docs/features/ai-supportをご覧ください。