Skip to main content

<Dialog>

Category: Visual tag

The Dialog tag renders a dialog box on a task with instructions or other content that you define — a read-only, chat-style list of messages taken from an array in task data. Each message shows the speaker's name, the text, an optional date and hint badge, and can be flagged as the selected message to draw the annotator's eye to the turn they must judge.

Dialog is display only: it produces no regions or results and cannot be the toName of a control tag. Use it to show conversational context next to the tags that do the labeling.

Use with the following data types: an array of message objects in task data.

Attributes​

AttributeTypeRequiredDefaultDescription
namestringyes—Name of the element
valuestringyes—Task-data key holding the message array, as $key (the leading $ is optional — value="dialog" reads the same key). Must be a top-level key; nested paths are not resolved.

Message object​

Each element of the array is rendered as one message bubble:

FieldTypeRequiredEffect
namestringyesSpeaker label, shown as name: before the text. Also seeds the bubble's background tint (a stable colour derived from the name, at 10% opacity), so every turn by the same speaker shares a tint.
textstringyesMessage body.
datestringnoShown after the text in a muted style.
hintstringnoShown as a blue tag after the message (magenta when the message is also selected).
selectedbooleannoHighlights the bubble and adds a magenta Selected Message tag (or shows the hint in magenta instead).

Behavior​

  • Messages render top-to-bottom in array order inside a column capped at 500 px tall with its own scrollbar, followed by a dashed divider.
  • Without task data (e.g. an empty preview) the tag renders an empty-state placeholder.

Examples​

Show a conversation next to a classification of its last turn​

<View>
<Dialog name="conv" value="$dialog"/>
<Choices name="intent" toName="conv_target" choice="single">
<Choice value="Greeting"/>
<Choice value="Request"/>
<Choice value="Complaint"/>
</Choices>
<Text name="conv_target" value="$last_turn"/>
</View>
{
"dialog": [
{ "name": "Customer", "text": "Ina kwana, ina so in biya kudin wuta.", "date": "09:12" },
{ "name": "Agent", "text": "Sannu. Wane lambar mita kake amfani da shi?", "date": "09:12", "hint": "clarifying" },
{ "name": "Customer", "text": "Lambar mita ta ita ce 0451…", "date": "09:13", "selected": true }
],
"last_turn": "Lambar mita ta ita ce 0451…"
}

The Choices tag points at the <Text> copy of the turn (Dialog can't be a toName), while the Dialog gives the annotator the full context and highlights the turn in question.

Gotchas​

  • Nothing is labelable inside a Dialog. To label spans or turns of a conversation, use <Paragraphs> (with <ParagraphLabels>); keep Dialog for context.
  • value must name a top-level task-data key whose value is an array; a missing or non-array key breaks rendering of the tag.
  • Every message needs a name and text; the other fields are optional.