Skip to content
هذه الصفحة غير متوفرة بلغتك بعد. يتم عرض النسخة الإنجليزية.

ICL Labeling

Scalable annotation के लिए मानव सत्यापन के साथ AI-assisted in-context learning।

AI-Assisted ICL Labeling

Potato की ICL (In-Context Learning) labeling feature, शेष data को label करने के लिए एक LLM को guide करने के लिए in-context examples के रूप में high-confidence human annotations का उपयोग करके AI-assisted annotation सक्षम करती है। System LLM confidence ट्रैक करती है और predictions को सत्यापन के लिए वापस humans के पास route करती है।

अवलोकन

ICL labeling system:

  1. High-Confidence Examples एकत्र करता है: ऐसे instances की पहचान करता है जहाँ annotators सहमत हैं (जैसे, 80%+ agreement)
  2. LLM के साथ label करता है: Unlabeled instances को label करने के लिए LLM को prompt करने के लिए examples का उपयोग करता है
  3. Confidence ट्रैक करता है: प्रत्येक prediction के लिए LLM confidence scores दर्ज करता है
  4. Accuracy सत्यापित करता है: Blind verification के लिए LLM-labeled instances का एक sample humans के पास route करता है
  5. Metrics रिपोर्ट करता है: Verification results के आधार पर LLM accuracy की गणना और प्रदर्शन करता है

विशेषताएँ

स्वचालित Example संग्रह

System स्वचालित रूप से high-confidence examples की पहचान करता है जहाँ कई annotators सहमत होते हैं:

  • Configurable agreement threshold (default: 80%)
  • न्यूनतम annotator count requirement (default: 2)
  • Configurable interval पर स्वचालित refresh
  • Per-schema example pools

सीमाओं के साथ LLM Labeling

Bulk labeling के बजाय iterative improvement सक्षम करने के लिए:

  • Max total labels: LLM predictions की कुल संख्या सीमित करें
  • Max unlabeled ratio: शेष data का केवल एक प्रतिशत label करें
  • Pause on low accuracy: यदि accuracy threshold से नीचे गिरे तो स्वचालित रूप से रोकें

Blind Verification

Verification "blind labeling" का उपयोग करती है - annotators instance को एक सामान्य task के रूप में देखते हैं, LLM की prediction जाने बिना:

  • Configurable sample rate (default: LLM labels का 20%)
  • कई selection strategies: low_confidence, random, mixed
  • Verification tasks नियमित assignments के साथ स्वाभाविक रूप से मिश्रित

कॉन्फ़िगरेशन

ICL labeling के लिए ai_support सक्षम होना आवश्यक है:

yaml
# AI endpoint configuration (required)
ai_support:
  enabled: true
  endpoint_type: "openai"
  ai_config:
    model: "gpt-4o-mini"
    api_key: "${OPENAI_API_KEY}"
 
# ICL labeling configuration
icl_labeling:
  enabled: true
 
  # Example selection settings
  example_selection:
    min_agreement_threshold: 0.8      # 80% annotators must agree
    min_annotators_per_instance: 2    # Minimum annotations for consensus
    max_examples_per_schema: 10       # Max examples per schema in prompt
    refresh_interval_seconds: 300     # How often to refresh examples
 
  # LLM labeling settings
  llm_labeling:
    batch_size: 20
    trigger_threshold: 5              # Min examples before LLM labeling starts
    confidence_threshold: 0.7         # Min confidence to accept prediction
    batch_interval_seconds: 600
    max_total_labels: 100             # Max instances to label total
    max_unlabeled_ratio: 0.5          # Max portion of unlabeled to label
    pause_on_low_accuracy: true
    min_accuracy_threshold: 0.7
 
  # Human verification settings
  verification:
    enabled: true
    sample_rate: 0.2                  # 20% of LLM labels verified
    selection_strategy: "low_confidence"
    mix_with_regular_assignments: true
    assignment_mix_rate: 0.2

Selection Strategies

  • low_confidence: LLM की सबसे कम confident predictions को पहले verify करने को प्राथमिकता देता है
  • random: सभी predictions से Random sampling
  • mixed: 50% low confidence + 50% random

Admin API

Status Endpoint

http
GET /admin/api/icl/status

प्रति schema examples, बनाई गई predictions, verification queue size, और accuracy metrics सहित समग्र ICL labeler status लौटाता है।

Examples Endpoint

http
GET /admin/api/icl/examples?schema=sentiment

High-confidence examples लौटाता है, वैकल्पिक रूप से schema द्वारा filtered।

Accuracy Endpoint

http
GET /admin/api/icl/accuracy?schema=sentiment

Human verification results के आधार पर accuracy metrics लौटाता है।

Manual Trigger Endpoint

http
POST /admin/api/icl/trigger
Content-Type: application/json
 
{"schema_name": "sentiment"}

किसी specific schema के लिए batch labeling manually trigger करें।

उपयोग Workflow

1. अपना Project Configure करें

yaml
ai_support:
  enabled: true
  endpoint_type: "openai"
  ai_config:
    model: "gpt-4o-mini"
    api_key: "${OPENAI_API_KEY}"
 
icl_labeling:
  enabled: true
  example_selection:
    min_agreement_threshold: 0.8
  llm_labeling:
    max_total_labels: 50  # Start small
  verification:
    enabled: true
    sample_rate: 0.3  # Verify 30% initially

2. Human Annotations एकत्र करें

Annotators को data सामान्य रूप से label करने दें। जैसे-जैसे वे consensus (80%+ agreement) तक पहुँचते हैं, वे instances examples के रूप में उपलब्ध हो जाते हैं।

3. प्रगति की निगरानी करें

bash
curl http://localhost:8000/admin/api/icl/status

4. Accuracy की समीक्षा करें

bash
curl http://localhost:8000/admin/api/icl/accuracy

5. Iterate करें

Accuracy के आधार पर:

  • यदि accuracy अधिक है (>80%), max_total_labels बढ़ाएँ
  • यदि accuracy कम है, जारी रखने से पहले अधिक human examples जोड़ें

सर्वोत्तम प्रथाएँ

  1. छोटे से शुरू करें: Scale करने से पहले accuracy assess करने के लिए conservative limits (max_total_labels: 50) से शुरू करें

  2. जल्दी Verify करें: Confident accuracy estimates प्राप्त करने के लिए शुरू में उच्च sample_rate (0.3-0.5) का उपयोग करें

  3. सक्रिय रूप से Monitor करें: Admin API के माध्यम से नियमित रूप से accuracy metrics जांचें

  4. Thresholds समायोजित करें: यदि LLM accuracy कम है:

    • Cleaner examples के लिए min_agreement_threshold बढ़ाएँ
    • Labeling से पहले अधिक examples के लिए trigger_threshold बढ़ाएँ
    • Uncertain predictions reject करने के लिए confidence_threshold कम करें
  5. Selection Strategies का उपयोग करें:

    • low_confidence: Problematic categories की पहचान के लिए सर्वश्रेष्ठ
    • random: Unbiased accuracy estimates के लिए सर्वश्रेष्ठ
    • mixed: Balanced approach

समस्या निवारण

LLM Labeling नहीं कर रहा

  1. जांचें कि ai_support ठीक से configure है
  2. सत्यापित करें कि पर्याप्त high-confidence examples मौजूद हैं
  3. जांचें कि labeling limits या low accuracy के कारण रोकी गई है या नहीं

कम Accuracy

  1. Cleaner examples के लिए min_agreement_threshold बढ़ाएँ
  2. अधिक annotation guidelines/instructions जोड़ें
  3. उपयोग किए जा रहे examples की समीक्षा करें (/admin/api/icl/examples)

Verification Tasks दिखाई नहीं दे रहे

  1. सत्यापित करें कि verification.enabled true है
  2. जांचें कि mix_with_regular_assignments true है
  3. सत्यापित करें कि queue में pending verifications हैं

आगे पढ़ें

कार्यान्वयन विवरण के लिए, source documentation देखें।