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:
- High-Confidence Examples एकत्र करता है: ऐसे instances की पहचान करता है जहाँ annotators सहमत हैं (जैसे, 80%+ agreement)
- LLM के साथ label करता है: Unlabeled instances को label करने के लिए LLM को prompt करने के लिए examples का उपयोग करता है
- Confidence ट्रैक करता है: प्रत्येक prediction के लिए LLM confidence scores दर्ज करता है
- Accuracy सत्यापित करता है: Blind verification के लिए LLM-labeled instances का एक sample humans के पास route करता है
- 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 सक्षम होना आवश्यक है:
# 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.2Selection Strategies
- low_confidence: LLM की सबसे कम confident predictions को पहले verify करने को प्राथमिकता देता है
- random: सभी predictions से Random sampling
- mixed: 50% low confidence + 50% random
Admin API
Status Endpoint
GET /admin/api/icl/statusप्रति schema examples, बनाई गई predictions, verification queue size, और accuracy metrics सहित समग्र ICL labeler status लौटाता है।
Examples Endpoint
GET /admin/api/icl/examples?schema=sentimentHigh-confidence examples लौटाता है, वैकल्पिक रूप से schema द्वारा filtered।
Accuracy Endpoint
GET /admin/api/icl/accuracy?schema=sentimentHuman verification results के आधार पर accuracy metrics लौटाता है।
Manual Trigger Endpoint
POST /admin/api/icl/trigger
Content-Type: application/json
{"schema_name": "sentiment"}किसी specific schema के लिए batch labeling manually trigger करें।
उपयोग Workflow
1. अपना Project Configure करें
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% initially2. Human Annotations एकत्र करें
Annotators को data सामान्य रूप से label करने दें। जैसे-जैसे वे consensus (80%+ agreement) तक पहुँचते हैं, वे instances examples के रूप में उपलब्ध हो जाते हैं।
3. प्रगति की निगरानी करें
curl http://localhost:8000/admin/api/icl/status4. Accuracy की समीक्षा करें
curl http://localhost:8000/admin/api/icl/accuracy5. Iterate करें
Accuracy के आधार पर:
- यदि accuracy अधिक है (>80%),
max_total_labelsबढ़ाएँ - यदि accuracy कम है, जारी रखने से पहले अधिक human examples जोड़ें
सर्वोत्तम प्रथाएँ
-
छोटे से शुरू करें: Scale करने से पहले accuracy assess करने के लिए conservative limits (
max_total_labels: 50) से शुरू करें -
जल्दी Verify करें: Confident accuracy estimates प्राप्त करने के लिए शुरू में उच्च
sample_rate(0.3-0.5) का उपयोग करें -
सक्रिय रूप से Monitor करें: Admin API के माध्यम से नियमित रूप से accuracy metrics जांचें
-
Thresholds समायोजित करें: यदि LLM accuracy कम है:
- Cleaner examples के लिए
min_agreement_thresholdबढ़ाएँ - Labeling से पहले अधिक examples के लिए
trigger_thresholdबढ़ाएँ - Uncertain predictions reject करने के लिए
confidence_thresholdकम करें
- Cleaner examples के लिए
-
Selection Strategies का उपयोग करें:
low_confidence: Problematic categories की पहचान के लिए सर्वश्रेष्ठrandom: Unbiased accuracy estimates के लिए सर्वश्रेष्ठmixed: Balanced approach
समस्या निवारण
LLM Labeling नहीं कर रहा
- जांचें कि
ai_supportठीक से configure है - सत्यापित करें कि पर्याप्त high-confidence examples मौजूद हैं
- जांचें कि labeling limits या low accuracy के कारण रोकी गई है या नहीं
कम Accuracy
- Cleaner examples के लिए
min_agreement_thresholdबढ़ाएँ - अधिक annotation guidelines/instructions जोड़ें
- उपयोग किए जा रहे examples की समीक्षा करें (
/admin/api/icl/examples)
Verification Tasks दिखाई नहीं दे रहे
- सत्यापित करें कि
verification.enabledtrue है - जांचें कि
mix_with_regular_assignmentstrue है - सत्यापित करें कि queue में pending verifications हैं
आगे पढ़ें
- AI Support - सामान्य AI endpoint कॉन्फ़िगरेशन
- Active Learning - संबंधित AI-assisted features
- Quality Control - Accuracy tracking
कार्यान्वयन विवरण के लिए, source documentation देखें।