Text annotation

Also known as: NLP annotation · text labeling

On this page 7

Text annotation is the process of attaching structured, machine-readable labels to written language, such as document categories, named entities, sentiment, intent or relations between words, so that the labeled text can serve as training data and evaluation data for natural language processing models. In artificial intelligence, it is also called NLP annotation or text labeling, and it remains the main way human judgment about meaning is converted into supervision signals a model can learn from.

The quality of annotated text sets an upper bound on model quality. A classifier or extraction model rarely becomes more consistent than the annotators who labeled its data, which is why mature projects invest as much in annotation guidelines, annotator training and quality control as in model architecture.

How text annotation turns language into labels

Text annotation works by defining a label schema, applying it to raw text units, and storing the result in a format that training code can read. The schema lists the allowed labels and their definitions; the annotation unit may be a whole document, a sentence, a span of characters or a pair of spans; and the output is usually stored as JSON Lines, CoNLL-style token columns or a tool-specific export.

Span-level work depends on tokenization and character offsets. Annotators mark a span in the interface, the tool records its start and end offsets, and a conversion step maps them to model tokens, often using the BIO or BILOU tagging scheme. Offset errors introduced at this step are a common, silent source of label corruption, so pipelines should validate that every exported span still matches the original text.

The following table shows the main stages of an annotation project and what each stage produces.

StageMain activityOutput
Schema designDefine labels, boundaries and edge casesLabel set and guidelines
Pilot roundLabel a small sample with several annotatorsAgreement scores and revised rules
Production labelingAnnotate the full datasetLabeled corpus
AdjudicationResolve disagreements between annotatorsGold-standard labels
Quality auditReview samples and measure error ratesAccepted or relabeled batches
Stages of a text annotation project

Main types of text annotation tasks

Text annotation tasks differ mainly in the granularity of the unit being labeled and the structure of the label. Document-level tasks are fast and cheap per item, while span and relation tasks demand more expertise, more time and stricter guidelines.

Task typeUnit labeledTypical use
Text classificationWhole document or messageTopic routing, spam detection
Sentiment annotationSentence or aspectReview analysis, brand monitoring
Named entity recognitionCharacter or token spanExtracting names, dates, amounts
Relation annotationPair of spansKnowledge graph construction
Intent and slot labelingUtterance and its spansChatbots and voice assistants
Preference rankingPairs of model outputsFine-tuning language models
Common text annotation task types

Recent large language model work has added generative annotation tasks, in which annotators write reference answers, rewrite responses or rank alternative outputs. These tasks feed instruction datasets and preference data, and they require far more domain knowledge than selecting a label from a list.

Measuring annotation quality and agreement

Annotation quality is measured by checking how consistently independent annotators label the same items, a property called inter-annotator agreement. Raw percentage agreement overstates consistency because some matches occur by chance, so projects use chance-corrected coefficients instead.

MetricApplies toPractical note
Cohen’s kappaTwo annotators, categorical labelsValues above 0.8 are usually considered strong
Fleiss’ kappaFixed number of several annotatorsSensitive to skewed label distributions
Krippendorff’s alphaAny number of annotators, missing dataSupports nominal, ordinal and interval labels
Span-level F1Entity and span tasksCompares one annotator against another as a reference
Agreement metrics used for annotated text

Agreement thresholds depend on the task. Subjective tasks such as sarcasm or toxicity labeling rarely reach a kappa of 0.7, and that is a property of the task, not necessarily a failure of the annotators. In such cases, teams often keep the full label distribution rather than forcing a single majority label, because the disagreement itself is informative.

Workforce and tooling options

The choice of workforce determines cost, speed and label reliability. Common options are in-house experts, managed vendors, crowdsourced labeling platforms and programmatic or model-assisted approaches, and many production pipelines combine several of them.

ApproachStrengthMain limitation
Domain expertsHighest accuracy on specialist textExpensive and slow to scale
Managed vendor teamsTrained, stable workforceRequires careful onboarding
CrowdsourcingFast and cheap for simple labelsNoisy without redundancy and checks
Programmatic labelingLabels millions of items quicklyRules encode systematic bias
Model-assisted pre-labelingCuts human effort per itemAnnotators may accept wrong suggestions
Who performs text annotation and when each option fits

Annotation platforms such as Label Studio, Labelbox or similar tools provide span selection, review queues and export formats. Active learning can reduce volume by sending only the most uncertain examples to humans, and human-in-the-loop labeling keeps people reviewing model suggestions instead of starting from an empty screen.

Limitations, risks and common mistakes

The most damaging annotation problems are systematic rather than random. Random slips average out over large datasets, but an ambiguous guideline applied the same wrong way thousands of times teaches the model a consistent error that evaluation on similarly labeled data will not reveal.

  • Vague guidelines: annotators invent their own rules for edge cases, which lowers agreement and creates label noise.
  • Schema drift: labels are redefined mid-project without relabeling earlier batches, so old and new data disagree.
  • Anchoring on pre-labels: annotators accept model suggestions too readily, which copies model errors into the dataset.
  • Annotator bias: the cultural and linguistic background of the workforce shapes subjective labels and contributes to dataset bias.
  • Privacy exposure: raw text often contains personal data, so redaction and access controls must precede labeling.

Teams can detect many of these issues with confident learning methods that flag examples whose labels conflict with model predictions, followed by targeted human review of the flagged items.

In simple terms

Text annotation means people marking up text so a computer can learn from it. A person reads a sentence and adds notes. One note might say that a word is a city. Another might say that a review is angry.

Think of a teacher grading essays with colored pens. Each color stands for one kind of mark. A computer studies thousands of marked essays and learns the patterns. Clear rules for marking matter most, because a model copies the mistakes of its teachers.

A practical example

A hospital network wants a model that extracts medication names, doses and frequencies from discharge notes. The data team removes patient identifiers first, then writes a 20-page guideline that covers edge cases such as combined products and doses written as ranges. Two trained clinical annotators label a pilot set of 300 notes, reach a span-level F1 of 0.86, and revise the guideline where they disagreed.

The production round covers 8,000 notes. A model trained on the first 2,000 notes pre-labels the remaining text, and annotators correct its suggestions, which cuts labeling time by about 40 percent per note. A senior pharmacist adjudicates conflicts and creates a 500-note gold-standard test set. The final extraction model reaches accuracy close to the human agreement level, and the team keeps the guideline under version control for future relabeling.