textAnnotation
Respondents highlight individual words in a passage of text using a small toolbar of annotation modes. Useful for copy testing, message diagnostics, sentiment-on-passage analysis, and "where-do-they-stop-reading" research.
What textAnnotation is
textAnnotation shows the respondent a passage of text and a
small toolbar of annotation modes. The respondent picks a
mode (e.g. Positive / Neutral / Negative), then clicks or
drags across words to mark them. Each tagged word stores a
sentiment value — +1 / 0 / -1 for the standard sentiment
codes, or a custom slot integer for non-sentiment codes — and the
runtime keeps a companion list visible alongside.
There’s a single canonical style: highlight.
w1, w2, …) automatically. You don’t have to label words ahead of time, paste in any per-word codes, or set up the storage shape yourself. Just write the passage: as ordinary text — the rest is automatic.Highlight words that stand out — positive or negative — and tell us what jumps out.
We've designed the new model to be the most rewarding, most intuitive, most refined experience we've ever made.
From its all-day battery to its silent operation, every detail rewards your attention and earns its place.
The toolbar shows three sentiment modes, Positive is active, the passage has a few words tinted green (positive) and grey (neutral). Click a mode, click or drag across words; the legend strip and counter update as you go.
Properties
| Property | Values | Notes |
|---|---|---|
qid | string | Required. Unique within the survey. |
type | textAnnotation | Required. |
title, text, instruction | renderable | Visible content. |
required | True | False | Default True. |
default.errors | True | False | custom string | Default True. |
validation | code block | Python; call fail() to reject. |
readonly | True | False | Default False. |
visibility | show | hide | Default show. |
style | highlight | Default and only canonical style. |
passage | block-scalar text | Required. The text the respondent reads and annotates. Multi-paragraph supported via blank lines. |
annotations | inline coded list | Required. Defines the annotation modes shown in the toolbar — one button per entry. |
min | integer | Minimum total words highlighted before Next is enabled. |
max | integer | Maximum words highlighted. |
exact | integer | Exact word count required. |
if | expression | Visibility / activation condition. |
options, options.from, group, group.order, scale, scale.from, decimal, decimal.places, label.prefix, label.suffix, input.source, input.size.Per-annotation entry properties
annotations: entries carry these per-mode properties.
| Property | Notes |
|---|---|
label | Required when expanding the entry to a map. The label shows on the toolbar button. |
data | Optional metadata object — not shown to the respondent, attached to the annotation in storage. |
Sentiment-aware codes and stored values
The renderer recognises a few annotation codes as sentiment hints and colours them accordingly. The respondent’s tag for each word stores as an integer:
| Code | Colour | Stored value |
|---|---|---|
pos / positive | Green | +1 |
neu / neutral | Grey | 0 |
neg / negative | Red | -1 |
Other codes get numbered slot styling (slot 2, 3, 4, …) and
their stored values are integers ≥ 2. The slot integers skip
1, which is reserved for pos. This means mixing custom codes
with pos in the same toolbar is fine — the storage values stay
distinct.
If a neu / neutral annotation exists, it becomes the
toolbar’s default-active mode; otherwise the first entry is the
default.
Examples
Simple sentiment highlighting
- qid: QAdCopy
type: textAnnotation
text: Highlight words that stand out — positive or negative — and tell us what jumps out.
passage: |
We've designed the new model to be the most rewarding,
most intuitive, most refined experience we've ever made.
From its all-day battery to its silent operation, every
detail rewards your attention and earns its place.
annotations:
pos: Positive
neu: Neutral
neg: Negative
min: 3
A toolbar with three buttons. The neu entry is auto-selected
on load. The respondent picks a mode, then clicks or drags
across words. min: 3 enforces at least three words highlighted
before Next.
Storage shape — wordId → sentiment value:
{
"words": {
"w7": 1,
"w8": 1,
"w9": 1,
"w24": 1,
"w34": 0,
"w35": 0
}
}
w7 etc. are word identifiers (counted from the start of the
passage). The values are the sentiment integers: +1 for
Positive words, 0 for Neutral, -1 for Negative. The
same value scheme is used by imageAnnotation’s
emoji style — sentiment storage stays consistent across
question types.
Beyond sentiment — labelled themes
- qid: QMessage
type: textAnnotation
text: Highlight the parts of this email that drove your decision.
passage: |
We've reviewed your request and we're pleased to confirm
your renewal at the standard rate. Your benefits remain
unchanged, and we'll bill you on the 15th of next month.
If anything looks off, reply to this message and our
support team will respond within 24 hours.
annotations:
clear: Clear
unclear: Unclear
important: Important
boilerplate: Boilerplate
Four custom labels. None of the codes match the sentiment
shortcuts, so each gets a numbered-slot colour and a slot
integer for storage (2, 3, 4, 5 — 1 stays reserved for
pos). The first entry (clear) is the toolbar’s default-active
mode since there’s no neu / neutral.
Word-count constraints
- qid: QExcerpt
type: textAnnotation
text: Pick the 5 most important words in this passage.
passage: |
Long-form passage of text here...
annotations:
important: Important
exact: 5
exact: 5 forces precisely five words highlighted — useful for
forced-choice exercises.
Methods & accessors
| Expression | Returns | Meaning |
|---|---|---|
Q.answered | bool | True once at least one word is annotated. |
Q.notAnswered | bool | Inverse. |
Q.reset() | — | Clear all word annotations. |
The full word map is stored in the runtime answer state but isn’t surfaced through canonical question-level accessors — analysis happens downstream from the export.
Export
textAnnotation exports the word map under the qid as a JSON
column or, in long format, as one row per highlighted word with
word_id, word_text, and the sentiment value (+1 / 0 /
-1) or custom slot integer. Long-format export is preferred for
analysis tools that aggregate words by mode (e.g. count of
positive words, ratio of positive to negative, frequency map).
See Long format for the export shape.
See also
- imageAnnotation — annotate spots on an image; same
+1/0/-1sentiment values - videoAnnotation — annotate moments in a video
- Long format — export shape for word-level annotations