# Text Classification

> Sorting text into groups that were picked first, like spam or not spam.

**Field:** Artificial Intelligence  
**Category:** NLP & Language  
**Also known as:** Text Categorization, Document Classification

## Think of it like

It is like sorting letters into boxes. Each letter goes in the box that fits it.

## Definition

Text classification puts a piece of text into one or more set groups. The groups are chosen first, such as spam or not spam, or billing, tech and sales. A model learns from examples that people have labeled. Then it labels new text by itself. Sentiment analysis and spam filters are both kinds of text classification. It is one of the most common jobs in NLP.

## Example

A help desk gets 5,000 emails a day. A model sorts each one into billing, tech or sales, so it reaches the right team.

## Why it matters

Much of the text a business gets needs sorting before anyone can act on it. A model does that in a moment.

## Common mistake

Picking groups that overlap. If an email could be billing or tech, people label it both ways and confuse the model.

## Three principles

- **Fixed groups.** Chosen before the model runs.
- **Learn from labels.** People label the examples.
- **Many kinds.** Spam, topic, mood and more.

## Related terms

- [Classification (Machine Learning)](https://learn.benibix.com/term/ai/classification)
- [Sentiment Analysis](https://learn.benibix.com/term/ai/sentiment-analysis)
- [Spam Filter](https://learn.benibix.com/term/ai/spam-filter)
- [Intent Detection](https://learn.benibix.com/term/ai/intent-detection)
- [Label (Machine Learning)](https://learn.benibix.com/term/ai/label)
- [Natural Language Processing (NLP)](https://learn.benibix.com/term/ai/natural-language-processing)

## Told apart from

- [Topic Modeling vs Text Classification](https://learn.benibix.com/compare/topic-modeling-vs-text-classification): People think topic modeling is just sorting text by topic. It is not. Text classification uses groups chosen ahead of time and learns them from labeled examples. Topic modeling has no groups and no labels. It finds themes from words that show up together, and a person names them after.

![One customer message, 'My card was charged twice, please fix it today', points to three outputs: a group, billing; an intent, refund request; and a set of fields for the problem, the count and the deadline.](https://learn.benibix.com/diagrams/ai5-text-analysis.svg)

---

Source: https://learn.benibix.com/term/ai/text-classification
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
