Document Classification using File Names
Zhijian Li, Stefan Larson, Kevin Leach
TL;DR
The paper tackles the computational bottleneck of large-scale document classification by showing that many documents can be accurately categorized using only their file names. It introduces a lightweight pipeline combining a universal tokenization scheme, TF-IDF guided keywords added to a trie (and optionally to a BERT tokenizer), and a set of fast classifiers, notably a Random Forest with a trie tokenizer. By leveraging a confidence-based deferral mechanism, the approach defers ambiguous or out-of-scope cases to heavier content-based models, achieving up to 99.78% accuracy at a 0.9 prediction rate on indicative file names and 96.57% on Common Crawl data, with inference times around $1.23\\times 10^{-4}$ seconds per prediction and up to $442\\times$ speedup over heavy models like DiT. The work demonstrates significant practical impact for fast, scalable document classification and introduces two publicly available datasets for further study, while outlining limitations and avenues for future enhancement through metadata integration.
Abstract
Rapid document classification is critical in several time-sensitive applications like digital forensics and large-scale media classification. Traditional approaches that rely on heavy-duty deep learning models fall short due to high inference times over vast input datasets and computational resources associated with analyzing whole documents. In this paper, we present a method using lightweight supervised learning models, combined with a TF-IDF feature extraction-based tokenization method, to accurately and efficiently classify documents based solely on file names, that substantially reduces inference time. Our results indicate that file name classifiers can process more than 90% of in-scope documents with 99.63% and 96.57% accuracy when tested on two datasets, while being 442x faster than more complex models such as DiT. Our method offers a crucial solution to efficiently process vast document datasets in critical scenarios, enabling fast and more reliable document classification.
