Skip to content

How to label data for machine learning

In brief

Start labeling by defining the model task, annotation unit and allowed answers. Write versioned guidelines for ambiguous cases, calibrate annotators against reference items, measure agreement and resolve disagreements before accepting batches. Preserve dataset versions, source permissions and contributor agreements so the resulting labels remain traceable and can later be assessed for licensing.

Labeling is a measurement process. The steps below make each judgment repeatable, reviewable and — if you later want to license the result — explainable to someone else.

Read the guide
Define the task → Apply expert judgment → Review the resultThree connected layers illustrate how a defined task becomes expert annotations and a reviewed reference.
Define the taskApply expert judgmentReview the result

Define the labeling task before anyone labels

Start with the decision the model will make, then work backward to the label. A label schema should state what is being judged, the allowed values, what to do when none of them fit, and which unit is being labeled — a whole image, a region, a sentence, a time span or a pair of model responses. Ambiguity at this stage becomes disagreement later, and disagreement caused by an unclear task cannot be fixed by adding more annotators.

Write down what the labels are for. Training data, evaluation data and data used to monitor a production system tolerate different error profiles. An evaluation set usually needs fewer items with more careful review; a training set may accept some noise in exchange for coverage. Recording the intended use also matters if the dataset is ever offered to another party, because permitted uses in a licence are easier to define when the original purpose is clear.

Write labeling guidelines that resolve hard cases

Guidelines are the specification annotators work from. Good guidelines spend little space on obvious examples and most of it on boundary cases: the partially visible object, the sarcastic review, the answer that is correct but unsafe. Each rule should include at least one positive and one negative example drawn from your real data.

  • Give every guideline a version number and a change log with dates.
  • Record which guideline version each label was produced under.
  • Add new hard cases as they appear during production, rather than resolving them informally in chat.
  • Name the person who owns the guideline and can rule on disputes.

Calibrate annotators with a gold set

Before production, build a small reference set with agreed answers, ideally adjudicated by your most qualified reviewers. Every new annotator completes it and receives feedback item by item. Set the pass threshold in advance and keep it in writing so that onboarding decisions are consistent.

Calibration is not a one-time gate. Seed gold items into live work at a steady rate and track each annotator against them over time. Drift is common after guideline changes or when the input distribution shifts, and seeded items are the cheapest way to catch it early. For specialist tasks, record how each annotator's qualifications were verified alongside their calibration results.

Quality assurance for labeled data

Layer quality checks rather than relying on one. A practical structure combines automatic validation of label format, seeded gold items, a second review of a sample from every batch, full adjudication of disagreements and an acceptance rule applied before a batch is merged into the dataset.

Classify rejected items by cause — guideline gap, annotator error, ambiguous input or tooling fault. The pattern tells you whether to retrain a person, rewrite a rule or exclude a category of input. Keep these records; they are some of the most persuasive evidence of quality you can show to anyone who later evaluates the data.

Measure inter-annotator agreement

Inter-annotator agreement shows whether the task is learnable from the guidelines. Have a share of items labeled independently by two or more annotators and compute a chance-corrected coefficient suited to your data, such as Cohen's kappa for two raters or Krippendorff's alpha for several raters, missing values or ordinal scales. Report the coefficient per label class and per batch, not only as a single project figure.

Low agreement is information, not just failure. It can mean the guidelines are unclear, the categories overlap, or the task genuinely requires expertise the annotators lack. Read the disagreeing items before deciding which. For subjective tasks such as preference ranking, some disagreement is expected; record it rather than forcing artificial consensus.

Version the labeled dataset

  • Assign an immutable version identifier to every release of the dataset.
  • Store the schema, guideline version and annotator pool details with each release.
  • Keep superseded labels instead of overwriting them, so changes can be traced.
  • Log which items were relabeled, why and by whom.
  • Record the source and agreement under which each subset of the raw material was obtained.

Common data labeling mistakes to avoid

  • Starting production before a pilot batch has been reviewed against the guidelines; early errors then repeat across thousands of items.
  • Changing a category definition without relabeling the items already done under the old rule, which silently mixes two standards in one dataset.
  • Measuring speed per annotator without measuring correction rate, which rewards fast but careless work.
  • Using pre-labels from a model without recording that they were model-generated and how often humans changed them.
  • Letting reviewers fix errors directly without logging the original label, so the dataset loses the evidence needed to diagnose recurring problems.
  • Leaving guideline decisions in private messages instead of the shared, versioned document every annotator reads.

How labeling documentation affects later licensing

Many labeled datasets are created for one internal project and only later recognized as valuable to others. At that point, the documentation produced during labeling decides how easy the data is to license. A prospective licensee will want to know where the underlying content came from, who produced the labels, under which agreements, against what standard and with what measured quality.

If annotators were contractors, check whether their agreements assign or license the work product to you. If the raw material contains personal data, record the consent or de-identification basis. A datasheet-style summary of motivation, composition, collection, labeling process and known limitations gives a reviewer a fast, honest picture of the asset. Labeling teams that keep these records from the start avoid an expensive reconstruction later — and our guides to label rights and licensing readiness explain what to check.

Have an annotated dataset or specialist expertise?

Tell us what you own, how the labels were reviewed and which rights you can license. A short overview of your dataset or annotation business is a useful place to start.

Prepare for a licensing conversation