WEBINAR Monitor LLMs and ML Models in Production with Label Studio 📈

HyperTextLabels

The HyperTextLabels tag creates labeled hyper text (HTML). Use with the HyperText object tag to annotate HTML text or HTML elements for named entity recognition tasks.

Use with the following data types: HTML.

Parameters

Param Type Default Description
name string Name of the element
toName string Name of the HTML element to label
[choice] single | multiple single Configure if you can select one or multiple labels
[maxUsages] number Maximum number of times a label can be used per task
[showInline] boolean true Show labels in the same visual line

Sample Results JSON

Name Type Description
value Object
value.start string xpath of the container where the region starts (xpath)
value.end string xpath of the container where the region ends (xpath)
value.startOffset number offset within start container
value.endOffset number offset within end container
[value.text] string text content of the region, can be skipped

Example JSON

{
  "value": {
    "start": "/div[1]/p[2]/text()[1]",
    "end": "/div[1]/p[4]/text()[3]",
    "startOffset": 2,
    "endOffset": 81,
    "hypertextlabels": ["Car"]
  }
}

Example

Basic semantic text labeling configuration

<View>
  <HyperTextLabels name="labels" toName="ht">
    <Label value="Header" />
    <Label value="Body Text" />
  </HyperTextLabels>
  <HyperText name="ht" value="$html" />
</View>
Unlock more with Enterprise Get a Demo