What is Document Classification?

Deciding what a document is, so the system knows what to do with it.

Document classification defined: assigning documents to categories by type and context, the rule-based, ML and LLM approaches, and threshold design.

Document classification is the assignment of a document to one or more predefined categories, most often its type, so that downstream processing knows how to handle it.

Classification is the decision that everything after it depends on. Extraction rules, validation logic, retention period, access restrictions and routing destination are all selected on the basis of what the document was determined to be.

What is being classified

Type is the obvious axis: invoice, purchase order, contract, passport, bank statement, delivery note. It is rarely the only one that matters in production.

Business context distinguishes documents of the same type that follow different processes, such as a domestic versus an import invoice, or a new-business versus a renewal application.

Record category determines retention. The same signed agreement may be an ordinary business record or a formally declared record with a statutory retention period. See records management.

Sensitivity drives access control and redaction. A document containing payment card data or health information needs handling rules applied at the point of classification, not after it has been distributed.

Routing need is sometimes classified directly, for example marking a document as requiring legal review regardless of its type.

Treating these as separate labels rather than folding them into one type taxonomy keeps the taxonomy from exploding combinatorially.

Three approaches, and where each breaks

Rule-based classification matches keywords, regular expressions, barcodes or layout fingerprints. It is transparent, cheap to run, and trivially explainable, which matters in regulated settings. It is brittle: a supplier redesigning their template, or a keyword appearing in an unexpected context, breaks it. Rules remain the correct choice when the signal is genuinely deterministic, such as a barcode or a form identifier printed on the page.

Machine-learning classification trains a model on labeled examples, using text features, layout features or both. It generalizes across template variation far better than rules. It requires labeled training data, it degrades when production documents drift away from the training distribution, and its errors are harder to explain to an auditor.

Large language model classification uses a general model, prompted or fine-tuned, and needs little or no task-specific training data. It handles unusual and previously unseen document types well and can classify on semantics rather than surface features. The trade-offs are cost per document at volume, latency, non-determinism between runs unless constrained, and a tendency to produce a plausible label for a document that should have been rejected as unclassifiable.

Most production systems combine them: deterministic rules where a reliable marker exists, a trained model for the high-volume known types, and an LLM as fallback for the tail.

Why thresholds belong per document type

A confidence score threshold decides which classifications are accepted automatically and which go to a person. Setting one global threshold is the most common design error in this stage.

The reason is that the cost of an error is not uniform. Misclassifying a marketing brochure as a delivery note wastes a few seconds. Misclassifying a legal notice as general correspondence can miss a statutory deadline. The first can safely auto-accept at moderate confidence; the second warrants review even at high confidence.

Class frequency compounds this. A type appearing in 40 percent of volume has abundant training signal and usually high genuine confidence. A type appearing in 0.5 percent has little, and its confidence values are less trustworthy at the same numeric level.

Per-type thresholds let a system automate the bulk while holding the rare and the consequential for human judgment. They also make the operating point explicit and reviewable, rather than buried in one number nobody can justify.

What commonly goes wrong

No unclassifiable outcome exists. Forcing every document into a category guarantees confident misclassification of anything genuinely novel. An explicit reject-or-review path is a requirement, not a nicety.

Multi-document files are ignored. A single scanned PDF frequently contains several documents. Without page-level splitting before classification, the file is labeled by whatever dominates its first page.

The taxonomy is designed by the wrong people. Categories defined by process owners tend to be actionable. Categories inherited from a filing structure tend to describe where documents used to be stored, which no longer helps.

Contellect One classifies documents as part of advanced information extraction.

See Contellect One in action

Book a personalized demo tailored to your team and use case.

Request a Demo