Skip to main content

<HyperText>

Category: Object tag

The HyperText tag displays hypertext markup for labeling. Use for labeling HTML-encoded text and webpages for NER and NLP projects.

Use with the following data types: HTML.

Attributes​

AttributeTypeRequiredDefaultDescription
namestringyes—Name of the element
valuestringyes—Value of the element
valueTypeurl,textnotextWhether the text is stored directly in uploaded data or needs to be loaded from a URL
inlinetrue,falsenofalseWhether to embed HTML directly in Label Studio or use an iframe
saveTextResultyes,nono—Whether to store labeled text along with the results. By default, doesn't store text for valueType=url
encodingnone,base64,base64unicodeno—How to decode values from encoded strings
selectionEnabledtrue,falsenotrueEnable or disable selection
clickableLinkstrue,falsenofalseWhether to allow opening resources from links in the hypertext markup.
highlightColorstringno—Hex string with highlight color, if not provided uses the labels color
showLabelstrue,falseno—Whether or not to show labels next to the region; unset (by default) — use editor settings; true/false — override settings
granularitysymbol,word,sentence,paragraphno—Control region selection granularity
dirltr,rtl,autono—Text direction for RTL / non-Latin script rendering. rtl renders Arabic-script HTML content right-to-left with correct bidi. In iframe render mode (the default for <HyperText>) the content is wrapped in a <div dir="rtl"> inside the sandboxed document so bidi cascades through the whole HTML tree. AfriAnnotate-specific.
directionltr,rtl,autono—CSS-familiar alias of dir. dir wins on collision. AfriAnnotate-specific.
langstring (BCP 47)no—Language tag such as ar (Arabic), am (Amharic), ha-Arab (Hausa Ajami), ff-Arab (Fulfulde Ajami), kr-Arab (Kanuri Ajami), or zgh-Tfng (Standard Moroccan Tamazight in Tifinagh). When set together with granularity="word" or granularity="sentence", selection snapping runs through Intl.Segmenter(lang) — ICU-backed word / sentence boundaries respecting the specific locale. Falls back to the browser Selection.modify path on missing lang, unsupported browsers, paragraph granularity, or multi-container selections. AfriAnnotate-specific.
unicodeBidinormal,embed,bidi-override,isolate,isolate-override,plaintextno—CSS unicode-bidi behaviour, mapped onto the wrapping container's style. Combine with dir for stubborn mixed-script rendering (e.g. Arabic quotations inside English body). AfriAnnotate-specific.

For the end-to-end walkthrough with six ready-made African-language template presets, see the RTL and non-Latin scripts guide.

Examples​

Labeling configuration to label HTML content​

<View>
<HyperText name="text-1" value="$text" />
<Labels name="parts" toName="text-1">
<Label value="Caption" />
<Label value="Article" />
<Label value="Author" />
</Labels>
</View>

Example 2​

<View>
<HyperText name="p1">
<p>Some explanations <em>with style</em></p>
</HyperText>
</View>