Text classification: define labels and evaluate predictions
A practical guide to category schemes, single- or multilabel output, and evaluation.
Text classification assigns predefined categories to text, such as routing a message to a support team. First define the labels and decide whether a text may have one category or several. The model score is not yet an action: thresholds and review rules determine the labels actually assigned.
Constructed example: a request to reset a password and unlock an account could receive one broad “account access” label, or both “password reset” and “account unlock.” These are different annotation rules, so decide before collecting examples. Separate confusing categories with counterexamples and record how annotators handle missing context.
Split data by source or user where needed to keep near-duplicates out of both training and test. Report precision and recall by class plus a clearly explained macro or micro aggregate; accuracy alone can hide rare-class failures. For multilabel tasks, state whether the entire label set must match. Choose thresholds on validation data according to the cost of false positives and missed labels, then evaluate once on held-out test data. Recheck after shifts in topic, language, or label prevalence.