Text Classification
Sorting text into categories — spam or not, positive or negative, which topic — the most widely deployed NLP task, and the one you've used a hundred times without noticing.
When not to use it
- When the task is really extraction or generation, not sorting into fixed buckets.
- When classes are ill-defined or overlapping — fix the label scheme before modelling.
- Judging skewed-class performance by accuracy — it hides failure on the rare class that usually matters most.
Reach for something else instead
- Named entity recognition when you need to extract spans, not label the whole document.
- Clustering when you don't have labels and want to discover groupings.
- Zero-shot LLM prompting when labels change often and per-call cost is acceptable.
Sources & further reading
- Joachims (1998), Text Categorization with Support Vector Machines — a foundational treatment of the classic approach.
- Devlin et al. (2018), BERT — fine-tuning pretrained transformers for classification.
- Manning, Raghavan & Schütze, Introduction to Information Retrieval — text classification fundamentals and evaluation.
Primary sources, listed so you can check the claims on this page rather than take them on trust.
Where people go wrong
- Using accuracy on imbalanced data — a trivial "majority class" model scores high and does nothing.
- Reaching for a heavy model when a logistic-regression baseline would win at a fraction of the cost.
- Under-investing in label quality, which caps the achievable performance regardless of model.