Skip to content
Guides4 min read

Smart Annotation Hints के लिए LLMs को Integrate करना

OpenAI, Claude, या Gemini का उपयोग करके अपने annotators को intelligent hints और suggestions प्रदान करना सीखें।

Potato Team·
此页面尚未提供您所选语言的版本,当前显示英文版本。

Smart Annotation Hints के लिए LLMs को Integrate करना

AI-assisted annotation से speed और quality दोनों में नाटकीय सुधार हो सकता है। यह गाइड intelligent suggestions प्रदान करने के लिए OpenAI, Claude, Gemini, और local models को integrate करने को cover करती है।

LLM Integration क्या enable करता है

  • Pre-annotation suggestions: AI review के लिए initial labels प्रदान करता है
  • Keyword highlighting: Relevant terms को automatically highlight करें
  • Quality hints: संभावित annotation errors को flag करें
  • Explanation generation: Annotators को कठिन cases समझने में मदद करें

Basic OpenAI Integration

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]

Supported Providers

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}

Local Models (Ollama)

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

Feature: Label Suggestions

AI models annotator consideration के लिए labels suggest कर सकते हैं:

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]

Feature: Keyword Highlighting

महत्वपूर्ण terms को automatically highlight करें:

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

Feature: Intelligent Hints

Annotators को contextual guidance प्रदान करें:

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

Hints contextual guidance के रूप में दिखाई देते हैं बिना उत्तर बताए, annotators को कठिन cases के माध्यम से सोचने में मदद करते हैं।

Complete AI-Assisted Configuration

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 Suggestions के साथ काम करना

जब AI support enabled हो, तो annotators annotation interface के साथ-साथ suggestions देखते हैं। वे AI की recommendations को accept, modify, या ignore कर सकते हैं। Final annotation हमेशा annotator के निर्णय को दर्शाती है, जो human oversight सुनिश्चित करती है।

AI responses को automatically cache किया जाता है जब caching enabled हो, इसलिए एक ही instance पर कई API calls trigger नहीं होंगे।

Custom Prompts

Potato में प्रत्येक annotation type के लिए default prompts शामिल हैं, जो potato/ai/prompt/ में stored हैं। आप prompt files edit करके इन्हें customize कर सकते हैं:

Annotation TypePrompt File
Radio buttonsradio_prompt.txt
Likert scaleslikert_prompt.txt
Checkboxescheckbox_prompt.txt
Span annotationspan_prompt.txt
Text inputtext_prompt.txt

Prompts {text}, {labels}, और {description} के साथ variable substitution support करते हैं।

AI-Assisted Annotation के लिए सुझाव

  1. Conservative शुरू करें: शुरुआत में सभी suggestions की समीक्षा करें
  2. Acceptance rates monitor करें: कम rates prompt issues दर्शाती हैं
  3. Prompts पर iterate करें: सामान्य errors के आधार पर refine करें
  4. Human oversight बनाए रखें: AI assist करता है, humans निर्णय लेते हैं
  5. AI vs human labels track करें: समय के साथ AI accuracy measure करें

v2.2 में नया: Option Highlighting

Potato 2.2 एक नई AI feature Option Highlighting जोड़ता है जो discrete annotation tasks (radio, multiselect, likert) के लिए सबसे likely correct options को highlight करने के लिए content का विश्लेषण करता है। Top-k options को star indicator के साथ highlight किया जाता है जबकि कम-likely options dimmed होते हैं, सभी options पूरी तरह clickable रहते हुए।

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

पूर्ण Option Highlighting documentation पढ़ें →

अगले कदम

  • Uncertain items को prioritize करने के लिए active learning enable करें
  • AI metrics के साथ quality control सेट करें
  • Privacy के लिए local models के बारे में जानें
  • Guided annotation के लिए option highlighting explore करें

पूर्ण AI documentation /docs/features/ai-support पर।