Text classification is the NLP task of assigning a piece of text to one or more predefined categories. The category set is fixed in advance. The model reads the text and decides which box it belongs in, sometimes returning a single label and sometimes several at once.
Common forms include spam detection, sentiment analysis, topic tagging, routing support tickets and content moderation. The classical approach converts text into numeric features and trains a classifier such as logistic regression or a support vector machine. Today the representations usually come from a language model, since it picks up context and synonyms on its own.
The difficulty is often in the label scheme rather than the model. When categories sit close together, annotators make different calls and the model learns that inconsistency. Imbalance is common too: if 95 percent of examples fall into one category, a model that does nothing still scores 95 percent accuracy.
A concrete case: written requests arriving at a bank's contact centre are sorted into 14 categories. After the model goes live, two categories keep getting confused. A review shows the definitions of those two are ambiguous for people as well. Merging them down to 13 categories lifts accuracy noticeably.
Accuracy alone is not enough as a measure. Without precision and recall per category, failure on the sparse categories stays invisible.

