> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/documentation/annotations/text-annotation.md).

# Text Annotation

Unitlab’s text Workbench keeps source text, span boundaries, entity identity, relations, classifications, and document-level context in one governed task. It supports precise named-entity recognition as well as nested and overlapping spans that simpler labeling interfaces cannot represent safely.

{% hint style="info" %}
**Use this guide when:** you are building NER, relation extraction, intent, sentiment, classification, information-extraction, or LLM training datasets.
{% endhint %}

## See text annotation in action

The demo shows text selection, entity labeling, and structured review within the current Unitlab interface.

{% embed url="<https://homepage-files.s3.us-east-2.amazonaws.com/hero-videos/hero/text-annotation-1.mp4>" %}

[Open the demo in a new tab](https://homepage-files.s3.us-east-2.amazonaws.com/hero-videos/hero/text-annotation-1.mp4).

## Before you begin

1. Create or select a project whose data and ontology match this modality.
2. Confirm the project instructions define the unit of annotation, boundary or timing policy, required properties, and review route.
3. Open the project and enter the assigned item from the project data view or queue. The Workbench loads the modality-native editor inside the shared Unitlab shell.

See [Annotation Workbench](/documentation/annotations/annotation-workbench.md) for navigation, saving, item state, comments, issues, and workflow actions.

## Understand the text work surface

The text editor keeps the source document readable while exposing ontology classes and structured values. Annotators select exact character spans, assign entity classes, connect entities with relations, and complete item-level classifications without rewriting the source content.

![Text with person, organization, location, topic, and arbitrary span annotations](/files/RHpBRqjDvFdP8tN6tf76)

*Entity labels preserve exact source spans while keeping surrounding language available for interpretation.*

## Supported annotation model

| Annotation type                  | Use it for                                                                               |
| -------------------------------- | ---------------------------------------------------------------------------------------- |
| **Named entity**                 | A typed span such as person, organization, location, product, date, or domain concept.   |
| **Arbitrary span**               | A project-defined phrase or token sequence that does not fit a standard entity taxonomy. |
| **Nested or overlapping entity** | Independent labels whose character ranges partially or fully overlap.                    |
| **Relation**                     | A directed or undirected connection between two annotated entities.                      |
| **Text classification**          | Intent, sentiment, topic, risk, or another label for the complete item.                  |
| **Entity property**              | Structured information that belongs to one entity.                                       |
| **Item Property**                | Document-level context, source, quality, language, or other whole-item value.            |

Span boundaries should follow a written policy for punctuation, articles, possessives, whitespace, and repeated mentions. The ontology defines meaning; visual highlight color alone does not.

## Relationships and entity linking

Select the source entity and create the ontology-defined relation to the intended target. Review relation direction, cardinality, and scope; a correct pair connected in the wrong direction is still structurally wrong. Use relations for facts such as works-for, located-in, refers-to, part-of, or any project-specific link.

![Directional relationships linking a person, organization, and location](/files/5OUMISWbCx0Tgum2xMcs)

*Relations turn isolated spans into a structured graph that downstream models can learn from.*

## Advanced text ontologies

Combine entity classes with nested properties, Item Properties, and controlled relations. Required values make incomplete annotations visible before submission. Reuse the ontology across projects when class definitions and value rules must remain stable.

![Text ontology with entities, attributes, relations, and Item Properties](/files/i9Kid1MFZlCHR5fhh3Fd)

*A structured ontology separates span location from semantic meaning and document-level context.*

## Nested, overlapping, and context-aware annotation

Create each valid label independently when entities overlap or one entity contains another. Preserve sentence, paragraph, and document context during review. For repeated mentions, follow the project’s coreference and mention policy rather than assuming the first label applies everywhere. AI-assisted proposals should be corrected against the source text, not accepted from confidence alone.

## Annotate one production item

{% stepper %}
{% step %}

#### 1. Read the full context

Review the item, instructions, language, and Item Properties before selecting the first span. Resolve whether the task is mention-level, entity-level, or document-level.
{% endstep %}

{% step %}

#### 2. Select the exact span

Highlight only the characters required by the boundary policy and choose the ontology class. Reopen the selection if punctuation or whitespace is wrong.
{% endstep %}

{% step %}

#### 3. Handle overlap intentionally

Create nested or overlapping entities as separate annotations when the policy permits them; do not merge distinct concepts to avoid overlap.
{% endstep %}

{% step %}

#### 4. Add entity structure

Complete required entity properties and create relations with the correct source, target, and direction.
{% endstep %}

{% step %}

#### 5. Complete whole-item labels

Add classifications and Item Properties that describe the complete text, not a single mention.
{% endstep %}

{% step %}

#### 6. Review and route

Scan every labeled span in context, inspect missed mentions and relation coverage, resolve validation, save, and use the current workflow action.
{% endstep %}
{% endstepper %}

## Quality review

| Review focus         | What to check                                                                       |
| -------------------- | ----------------------------------------------------------------------------------- |
| **Span boundary**    | Apply the same token, punctuation, whitespace, and article policy to every mention. |
| **Class meaning**    | Check the label definition against context, not surface wording alone.              |
| **Overlap**          | Preserve valid nested entities without creating accidental duplicates.              |
| **Relations**        | Check source, target, direction, and required relation coverage.                    |
| **Document context** | Review classification and Item Properties against the complete item.                |

{% hint style="warning" %}
A saved annotation is not automatically a production-ready annotation. Required values, boundary or timing policy, cross-item consistency, and the configured review stage still apply.
{% endhint %}

## Move from labels to governed data

Text exports should preserve character offsets, source text identity, nested spans, relations, properties, and document-level labels. If text normalization occurs downstream, maintain a traceable mapping back to the original offsets and version the ontology with the dataset.

![Integrated Unitlab workflow connecting model assistance, annotation, review, and quality assurance](/files/yPoYNby78Kd9mxWTVqxy)

*Use workflows to keep model output, human correction, review, and approval in one traceable operating path.*

## Next steps

* Use [Detect Anything (SAM 1–SAM 3)](/documentation/auto-labeling/detect-anything-sam-1-sam-3.md) to calibrate interactive and batch assistance.
* Use [Multimodal overview](/documentation/multimodal-annotations/multimodal-overview.md) when related files or views must stay in one task.
* Curate difficult cases and review cohorts in [Data curation](/documentation/data/data-curation.md).
* Read the current [text annotation product overview](https://unitlab.ai/en/text-annotation) for the feature overview and current media.
