Instanzanzeige
Inhaltsanzeige von der Annotation mit dem instance_display-Konfigurationsblock trennen.
Instanzanzeige
Neu in v2.1.0
Die Instanzanzeige trennt welche Inhalte Annotatoren sehen von welche Annotationen gesammelt werden. Dadurch können Sie beliebige Kombinationen von Inhaltstypen (Bilder, Videos, Audio, Text) neben beliebigen Annotationsschemata (Optionsfelder, Kontrollkästchen, Spans usw.) anzeigen.
Warum die Instanzanzeige verwenden?
Bisher mussten Sie, wenn Sie ein Bild mit Optionsfeldern zur Klassifizierung anzeigen wollten, ein image_annotation-Schema mit min_annotations: 0 hinzufügen, nur um das Bild anzuzeigen. Dies war verwirrend und semantisch falsch.
Mit instance_display konfigurieren Sie explizit, welche Inhalte angezeigt werden sollen:
# 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]Grundkonfiguration
Fügen Sie einen instance_display-Abschnitt zu Ihrer YAML-Konfiguration hinzu:
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"Unterstützte Anzeigetypen
| Typ | Beschreibung | Span-Ziel |
|---|---|---|
text | Reiner Textinhalt | Ja |
html | Bereinigter HTML-Inhalt | Nein |
image | Bildanzeige mit Zoom | Nein |
video | Video-Player | Nein |
audio | Audio-Player | Nein |
dialogue | Gesprächsverläufe | Ja |
pairwise | Nebeneinander-Vergleich | Nein |
code | Syntaxhervorgehobener Quellcode | Ja |
spreadsheet | Tabellarische Daten (Excel/CSV) | Ja (Zeile/Zelle) |
document | Rich-Dokumente (Word, Markdown, HTML) | Ja |
pdf | PDF-Dokumente mit Seitensteuerung | Ja |
Optionen für Anzeigetypen
Textanzeige
- 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 spacingBildanzeige
- 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 propertyVideoanzeige
- 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 mutedAudioanzeige
- key: "audio_url"
type: "audio"
label: "Audio"
display_options:
controls: true # Show audio controls
autoplay: false
loop: false
show_waveform: false # Show waveform visualizationDialogatzeige
- 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 numbersDatenformat für Dialog (jede Zeile in einer JSONL-Datei):
{"id": "conv_001", "conversation": ["Speaker A: Hello there!", "Speaker B: Hi, how are you?"]}Oder mit strukturierten Daten:
{"id": "conv_001", "conversation": [{"speaker": "Alice", "text": "Hello there!"}, {"speaker": "Bob", "text": "Hi, how are you?"}]}Paarweise Anzeige
- 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 mobileLayoutoptionen
Steuern Sie, wie mehrere Felder angeordnet werden:
instance_display:
layout:
direction: horizontal # horizontal or vertical
gap: 24px # Space between fieldsUnterstützung für Span-Annotation
Textbasierte Anzeigetypen (text, dialogue) können als Ziele für Span-Annotationen dienen:
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]Mehrere Span-Ziele
Sie können mehrere Textfelder verwenden, die Span-Annotation unterstützen:
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]Wenn mehrere Span-Ziele verwendet werden, werden Annotationen mit Feldzuordnung gespeichert:
{
"factual_errors": {
"source_text": [],
"summary": [
{"start": 45, "end": 67, "label": "unsupported"}
]
}
}Annotationsschemata mit Anzeigefeldern verknüpfen
Für Medien-Annotationsschemata (image_annotation, video_annotation, audio_annotation) verknüpfen Sie diese über source_field mit Anzeigefeldern:
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]Bewertungen pro Gesprächszug
Inline-Bewertungs-Widgets zu einzelnen Dialogzügen hinzufügen:
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"]Bewertungskreise erscheinen inline unter dem Zug des jeweiligen Sprechers. Bewertungen füllen sich bis zum gewählten Wert, und alle Bewertungen pro Zug werden als einzelnes JSON-Objekt gespeichert:
{
"turn_quality": "{\"0\": 4, \"2\": 5, \"4\": 3}"
}Beispiel: Bildklassifizierung
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: trueBeispiel-Datendatei (data/images.json) im JSONL-Format:
{"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"}Beispiel: Multimodale Annotation
Video neben einem Transkript mit Span-Annotation:
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_evidenceAbwärtskompatibilität
- Bestehende Konfigurationen ohne
instance_displayfunktionieren weiterhin unverändert - Der
text_keyausitem_propertieswird weiterhin als Fallback verwendet - Die bisherige Medienerkennung über Annotationsschemata funktioniert weiterhin
- In den Protokollen erscheint eine Veraltungswarnung, wenn das alte Anzeigemuster verwendet wird
Migration von reinen Anzeigemustern
Wenn Sie Annotationsschemata nur zur Inhaltsdarstellung verwendet haben:
Vorher (veraltet):
annotation_schemes:
- annotation_type: image_annotation
name: image_display
min_annotations: 0
tools: [bbox]
labels: [unused]Nachher (empfohlen):
instance_display:
fields:
- key: image_url
type: imageWeiterführende Informationen
- Datenformate – Unterstützte Eingabedatenformate
- UI-Konfiguration – Anpassung der Benutzeroberfläche
- Layout-Anpassung – Benutzerdefinierte HTML-Vorlagen
- Bildannotation – Werkzeuge zur Bildannotation
Implementierungsdetails finden Sie in der Quelldokumentation.