Skip to content
Questa pagina non è ancora disponibile nella tua lingua. Viene mostrata la versione in inglese.

इंस्टेंस डिस्प्ले

instance_display कॉन्फ़िग ब्लॉक के साथ सामग्री प्रदर्शन को एनोटेशन से अलग करें।

इंस्टेंस डिस्प्ले

v2.1.0 में नया

इंस्टेंस डिस्प्ले एनोटेटरों को क्या सामग्री दिखानी है को क्या एनोटेशन एकत्र करनी है से अलग करता है। यह आपको किसी भी एनोटेशन स्कीम (रेडियो बटन, चेकबॉक्स, स्पैन, आदि) के साथ किसी भी प्रकार की सामग्री (छवियाँ, वीडियो, ऑडियो, पाठ) का कोई भी संयोजन प्रदर्शित करने की अनुमति देता है।

इंस्टेंस डिस्प्ले का उपयोग क्यों करें?

पहले, यदि आप वर्गीकरण के लिए रेडियो बटन के साथ एक छवि दिखाना चाहते थे, तो आपको छवि प्रदर्शित करने के लिए min_annotations: 0 के साथ image_annotation स्कीमा जोड़नी होती थी। यह भ्रामक और अर्थपूर्ण रूप से गलत था।

instance_display के साथ, आप स्पष्ट रूप से कॉन्फ़िगर करते हैं कि क्या प्रदर्शित करना है:

yaml
# 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 अनुभाग जोड़ें:

yaml
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 दस्तावेज़हाँ

डिस्प्ले प्रकार विकल्प

पाठ डिस्प्ले

yaml
- 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

छवि डिस्प्ले

yaml
- 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

वीडियो डिस्प्ले

yaml
- 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

ऑडियो डिस्प्ले

yaml
- key: "audio_url"
  type: "audio"
  label: "Audio"
  display_options:
    controls: true            # Show audio controls
    autoplay: false
    loop: false
    show_waveform: false      # Show waveform visualization

डायलॉग डिस्प्ले

yaml
- 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 फ़ाइल में प्रत्येक पंक्ति):

json
{"id": "conv_001", "conversation": ["Speaker A: Hello there!", "Speaker B: Hi, how are you?"]}

या संरचित डेटा के साथ:

json
{"id": "conv_001", "conversation": [{"speaker": "Alice", "text": "Hello there!"}, {"speaker": "Bob", "text": "Hi, how are you?"}]}

Pairwise डिस्प्ले

yaml
- 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

लेआउट विकल्प

नियंत्रित करें कि एकाधिक फील्ड कैसे व्यवस्थित होते हैं:

yaml
instance_display:
  layout:
    direction: horizontal  # horizontal or vertical
    gap: 24px              # Space between fields

स्पैन एनोटेशन समर्थन

पाठ-आधारित डिस्प्ले प्रकार (text, dialogue) स्पैन एनोटेशन के लिए लक्ष्य हो सकते हैं:

yaml
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]

एकाधिक स्पैन टार्गेट

आपके पास एकाधिक पाठ फील्ड हो सकते हैं जो स्पैन एनोटेशन का समर्थन करती हैं:

yaml
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]

जब एकाधिक स्पैन टार्गेट उपयोग किए जाते हैं, तो एनोटेशन फील्ड एसोसिएशन के साथ संग्रहीत होते हैं:

json
{
  "factual_errors": {
    "source_text": [],
    "summary": [
      {"start": 45, "end": 67, "label": "unsupported"}
    ]
  }
}

एनोटेशन स्कीमा को डिस्प्ले फील्ड से लिंक करना

मीडिया एनोटेशन स्कीमा (image_annotation, video_annotation, audio_annotation) के लिए, source_field का उपयोग करके उन्हें डिस्प्ले फील्ड से लिंक करें:

yaml
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]

प्रति-टर्न डायलॉग रेटिंग

अलग-अलग डायलॉग टर्न में इनलाइन रेटिंग विजेट जोड़ें:

yaml
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 ऑब्जेक्ट के रूप में संग्रहीत होती हैं:

json
{
  "turn_quality": "{\"0\": 4, \"2\": 5, \"4\": 3}"
}

उदाहरण: छवि वर्गीकरण

yaml
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 प्रारूप में:

json
{"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"}

उदाहरण: मल्टी-मोडल एनोटेशन

स्पैन एनोटेशन के साथ ट्रांसक्रिप्ट के साथ वीडियो:

yaml
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):

yaml
annotation_schemes:
  - annotation_type: image_annotation
    name: image_display
    min_annotations: 0
    tools: [bbox]
    labels: [unused]

बाद (recommended):

yaml
instance_display:
  fields:
    - key: image_url
      type: image

आगे पढ़ें

कार्यान्वयन विवरण के लिए, स्रोत दस्तावेज़ देखें।