इंस्टेंस डिस्प्ले
instance_display कॉन्फ़िग ब्लॉक के साथ सामग्री प्रदर्शन को एनोटेशन से अलग करें।
इंस्टेंस डिस्प्ले
v2.1.0 में नया
इंस्टेंस डिस्प्ले एनोटेटरों को क्या सामग्री दिखानी है को क्या एनोटेशन एकत्र करनी है से अलग करता है। यह आपको किसी भी एनोटेशन स्कीम (रेडियो बटन, चेकबॉक्स, स्पैन, आदि) के साथ किसी भी प्रकार की सामग्री (छवियाँ, वीडियो, ऑडियो, पाठ) का कोई भी संयोजन प्रदर्शित करने की अनुमति देता है।
इंस्टेंस डिस्प्ले का उपयोग क्यों करें?
पहले, यदि आप वर्गीकरण के लिए रेडियो बटन के साथ एक छवि दिखाना चाहते थे, तो आपको छवि प्रदर्शित करने के लिए min_annotations: 0 के साथ image_annotation स्कीमा जोड़नी होती थी। यह भ्रामक और अर्थपूर्ण रूप से गलत था।
instance_display के साथ, आप स्पष्ट रूप से कॉन्फ़िगर करते हैं कि क्या प्रदर्शित करना है:
# OLD (deprecated workaround)
annotation_schemes:
- annotation_type: image_annotation
name: image_display
min_annotations: 0 # Just to show the image
tools: [bbox]
labels: [unused]
- annotation_type: radio
name: category
labels: [A, B, C]
# NEW (recommended)
instance_display:
fields:
- key: image_url
type: image
annotation_schemes:
- annotation_type: radio
name: category
labels: [A, B, C]बुनियादी कॉन्फ़िगरेशन
अपनी YAML कॉन्फ़िगरेशन में एक instance_display अनुभाग जोड़ें:
instance_display:
fields:
- key: "image_url" # Field name in your data JSON
type: "image" # Content type
label: "Image to classify" # Optional header
display_options:
max_width: 600
zoomable: true
layout:
direction: "vertical" # vertical or horizontal
gap: "20px"समर्थित डिस्प्ले प्रकार
| प्रकार | विवरण | स्पैन टार्गेट |
|---|---|---|
text | सादा पाठ सामग्री | हाँ |
html | सैनिटाइज़ HTML सामग्री | नहीं |
image | ज़ूम के साथ छवि डिस्प्ले | नहीं |
video | वीडियो प्लेयर | नहीं |
audio | ऑडियो प्लेयर | नहीं |
dialogue | वार्तालाप टर्न | हाँ |
pairwise | साइड-बाय-साइड तुलना | नहीं |
code | सिंटैक्स-हाइलाइट किया गया स्रोत कोड | हाँ |
spreadsheet | सारणीबद्ध डेटा (Excel/CSV) | हाँ (पंक्ति/सेल) |
document | समृद्ध दस्तावेज़ (Word, Markdown, HTML) | हाँ |
pdf | पृष्ठ नियंत्रण के साथ PDF दस्तावेज़ | हाँ |
डिस्प्ले प्रकार विकल्प
पाठ डिस्प्ले
- key: "text"
type: "text"
label: "Document"
display_options:
collapsible: false # Make content collapsible
max_height: 400 # Max height in pixels before scrolling
preserve_whitespace: true # Preserve line breaks and spacingछवि डिस्प्ले
- key: "image_url"
type: "image"
label: "Image"
display_options:
max_width: 800 # Max width (number or CSS string)
max_height: 600 # Max height
zoomable: true # Enable zoom controls
alt_text: "Description" # Alt text for accessibility
object_fit: "contain" # CSS object-fit propertyवीडियो डिस्प्ले
- key: "video_url"
type: "video"
label: "Video"
display_options:
max_width: 800
max_height: 450
controls: true # Show video controls
autoplay: false # Auto-play on load
loop: false # Loop playback
muted: false # Start mutedऑडियो डिस्प्ले
- key: "audio_url"
type: "audio"
label: "Audio"
display_options:
controls: true # Show audio controls
autoplay: false
loop: false
show_waveform: false # Show waveform visualizationडायलॉग डिस्प्ले
- key: "conversation"
type: "dialogue"
label: "Conversation"
display_options:
alternating_shading: true # Alternate background colors
speaker_extraction: true # Extract "Speaker:" from text
show_turn_numbers: false # Show turn numbersडायलॉग के लिए डेटा प्रारूप (JSONL फ़ाइल में प्रत्येक पंक्ति):
{"id": "conv_001", "conversation": ["Speaker A: Hello there!", "Speaker B: Hi, how are you?"]}या संरचित डेटा के साथ:
{"id": "conv_001", "conversation": [{"speaker": "Alice", "text": "Hello there!"}, {"speaker": "Bob", "text": "Hi, how are you?"}]}Pairwise डिस्प्ले
- key: "comparison"
type: "pairwise"
label: "Compare Options"
display_options:
cell_width: "50%" # Width of each cell
show_labels: true # Show A/B labels
labels: ["Option A", "Option B"]
vertical_on_mobile: true # Stack vertically on mobileलेआउट विकल्प
नियंत्रित करें कि एकाधिक फील्ड कैसे व्यवस्थित होते हैं:
instance_display:
layout:
direction: horizontal # horizontal or vertical
gap: 24px # Space between fieldsस्पैन एनोटेशन समर्थन
पाठ-आधारित डिस्प्ले प्रकार (text, dialogue) स्पैन एनोटेशन के लिए लक्ष्य हो सकते हैं:
instance_display:
fields:
- key: "document"
type: "text"
span_target: true # Enable span annotation on this field
annotation_schemes:
- annotation_type: span
name: entities
labels: [PERSON, LOCATION, ORG]एकाधिक स्पैन टार्गेट
आपके पास एकाधिक पाठ फील्ड हो सकते हैं जो स्पैन एनोटेशन का समर्थन करती हैं:
instance_display:
fields:
- key: "source_text"
type: "text"
label: "Source Document"
span_target: true
- key: "summary"
type: "text"
label: "Summary"
span_target: true
annotation_schemes:
- annotation_type: span
name: factual_errors
labels: [contradiction, unsupported, fabrication]जब एकाधिक स्पैन टार्गेट उपयोग किए जाते हैं, तो एनोटेशन फील्ड एसोसिएशन के साथ संग्रहीत होते हैं:
{
"factual_errors": {
"source_text": [],
"summary": [
{"start": 45, "end": 67, "label": "unsupported"}
]
}
}एनोटेशन स्कीमा को डिस्प्ले फील्ड से लिंक करना
मीडिया एनोटेशन स्कीमा (image_annotation, video_annotation, audio_annotation) के लिए, source_field का उपयोग करके उन्हें डिस्प्ले फील्ड से लिंक करें:
instance_display:
fields:
- key: "image_url"
type: "image"
annotation_schemes:
- annotation_type: image_annotation
source_field: "image_url" # Links to display field
tools: [bbox]
labels: [person, car]प्रति-टर्न डायलॉग रेटिंग
अलग-अलग डायलॉग टर्न में इनलाइन रेटिंग विजेट जोड़ें:
instance_display:
fields:
- key: conversation
type: dialogue
label: "Conversation"
display_options:
show_turn_numbers: true
per_turn_ratings:
speakers: ["Agent"] # Only show ratings for these speakers
schema_name: "turn_quality" # Name for the stored annotation data
scheme:
type: likert
size: 5
labels: ["Poor", "Excellent"]रेटिंग सर्कल प्रत्येक मेल खाने वाले स्पीकर के टर्न के नीचे इनलाइन दिखाई देते हैं। रेटिंग चयनित मूल्य तक भरती हैं, और सभी प्रति-टर्न रेटिंग एकल JSON ऑब्जेक्ट के रूप में संग्रहीत होती हैं:
{
"turn_quality": "{\"0\": 4, \"2\": 5, \"4\": 3}"
}उदाहरण: छवि वर्गीकरण
annotation_task_name: "Image Classification"
data_files:
- data/images.json
item_properties:
id_key: id
text_key: image_url
task_dir: .
output_annotation_dir: annotation_output
instance_display:
fields:
- key: image_url
type: image
label: "Image to Classify"
display_options:
max_width: 600
zoomable: true
- key: context
type: text
label: "Additional Context"
display_options:
collapsible: true
annotation_schemes:
- annotation_type: radio
name: category
description: "What category best describes this image?"
labels:
- nature
- urban
- people
- objects
user_config:
allow_all_users: trueनमूना डेटा फ़ाइल (data/images.json) JSONL प्रारूप में:
{"id": "img_001", "image_url": "https://example.com/image1.jpg", "context": "Taken in summer 2023"}
{"id": "img_002", "image_url": "https://example.com/image2.jpg", "context": "Winter landscape"}उदाहरण: मल्टी-मोडल एनोटेशन
स्पैन एनोटेशन के साथ ट्रांसक्रिप्ट के साथ वीडियो:
annotation_task_name: "Video Analysis"
instance_display:
layout:
direction: horizontal
gap: 24px
fields:
- key: video_url
type: video
label: "Video"
display_options:
max_width: "45%"
- key: transcript
type: text
label: "Transcript"
span_target: true
annotation_schemes:
- annotation_type: radio
name: sentiment
labels: [positive, neutral, negative]
- annotation_type: span
name: highlights
labels:
- key_point
- question
- supporting_evidenceपिछड़ी संगतता
instance_displayके बिना मौजूदा कॉन्फ़िग अपरिवर्तित काम करते रहते हैंitem_propertiesकाtext_keyअभी भी फॉलबैक के रूप में उपयोग होता है- एनोटेशन स्कीमा के माध्यम से लीगेसी मीडिया डिटेक्शन अभी भी काम करता है
- पुराने डिस्प्ले-ओनली पैटर्न का उपयोग करने पर लॉग में एक डेप्रेकेशन चेतावनी दिखाई देती है
डिस्प्ले-ओनली पैटर्न से माइग्रेशन
यदि आप सामग्री प्रदर्शित करने के लिए केवल एनोटेशन स्कीमा का उपयोग कर रहे थे:
पहले (deprecated):
annotation_schemes:
- annotation_type: image_annotation
name: image_display
min_annotations: 0
tools: [bbox]
labels: [unused]बाद (recommended):
instance_display:
fields:
- key: image_url
type: imageआगे पढ़ें
- Data Formats - समर्थित इनपुट डेटा प्रारूप
- UI Configuration - इंटरफ़ेस कस्टमाइज़ेशन
- Layout Customization - कस्टम HTML टेम्पलेट
- Image Annotation - छवि एनोटेशन टूल
कार्यान्वयन विवरण के लिए, स्रोत दस्तावेज़ देखें।