ModelRefs / Text Classification — AI Glossary

Text Classification — AI Glossary

Assigning predefined categories or labels to text spans or documents using ML models.

Overview

LLMs enable zero-shot and few-shot text classification without labeled training data: sentiment, topic, intent, toxicity, and routing classification via prompting. For high-volume production, fine-tuned encoder models (BERT, RoBERTa) are faster and cheaper. LLM-as-judge can generate training labels for smaller classifiers (distillation).

Reference details

Topicapplications
Last reviewed2026-06-24

Example: Find the crossover before you pick the architecture

Zero-shot classification with a general model needs no labelled data and works the day you write the prompt — but you pay per call, and every call sends the instructions again. A fine-tuned encoder needs labelled examples up front and then classifies for a fraction of the cost, fast enough to run on modest hardware. The decision is a crossover, not a preference: below some daily volume the prompt wins because labelling is the expensive part; above it the encoder wins because inference is. The productive path is usually both — use the large model to label, then train the small one on those labels.

Commonly confused with

Classification assigns a label from a closed set; extraction pulls typed values out of text; generation writes new text. Framing a task as classification is what makes it measurable — precision, recall and a confusion matrix per class — which is why converting an open-ended judgement into a labelled decision is usually the first useful step.

When to use it

Reach for it when:

  • Routing, triage, moderation and intent detection, where the label set is known
  • Cold start with no labelled data, using a general model to bootstrap
  • High volume with stable classes, using a small fine-tuned model distilled from those labels

Reach for something else when:

  • Where classes overlap or shift constantly and the label set cannot be pinned down
  • Without a confusion matrix — aggregate accuracy hides collapse on the rare class that matters
  • For nuanced judgements that need a rationale, where a label alone is not actionable

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Text Classification — AI Glossary.

Frequently asked questions

What is Text Classification?

Assigning predefined categories or labels to text spans or documents using ML models.

What concepts are related to Text Classification?

Closely related concepts include named entity recognition, sentiment analysis, information extraction.