Comparative Study of Long Document Classification

Vedangi Wagh, Snehal Ishwar Khandve, Isha Joshi, Apurva Dinesh Wani, Geetanjali Kale, Raviraj JoshiTENCON 2021

Abstract

This paper provides a comprehensive benchmark of text classification models—ranging from traditional Naive Bayes to state-of-the-art Transformers—specifically for long documents. The study reveals that while BERT-based models generally lead in accuracy, simpler "shallow" neural networks and basic bag-of-words approaches perform surprisingly well. This suggests that long document classification may be a simpler task than often assumed due to an abundance of classification signals inherent in longer texts.

Introduction

In the field of Natural Language Processing (NLP), "long documents" (consisting of multiple paragraphs) present unique challenges compared to short snippets. Unlike tweets or short reviews, long texts require models to maintain context over a large span. While research in text classification is plentiful, existing literature is often fragmented, with researchers testing different models on varying datasets. This study seeks to provide a holistic view by benchmarking a wide variety of model families on a standardized set of six datasets.

Methodology

The experimental models were categorized into three main groups:

  1. Traditional/Non-Neural: TF-IDF features paired with a Naive Bayes classifier.
  2. Shallow Neural Networks: Models trained from scratch, including word embedding averages (GloVe), LSTMs, CNNs, and Hierarchical Attention Networks (HAN).
  3. Pre-trained Transformers: Universal Sentence Encoder (USE), ULMFiT, BERT, and DistilBERT.

These models were evaluated across six standard benchmarks: BBC News, BBC Sports, AG News, 20 Newsgroups, R8, and IMDB.

Key Insights and Visual Analysis

A primary finding is the "Abundance of Signals" hypothesis. Because long documents contain more words, they provide more keywords and context that even simple models can leverage. However, the task type is a critical factor: topic-based classification is well-handled by simpler models, whereas sentiment analysis (e.g., IMDB) requires the deeper semantic understanding of Transformers.

The impact of model choice and fine-tuning is evident in document representation space. t-SNE visualizations show that while pre-trained models like the Universal Sentence Encoder (USE) have distinct clusters out of the box, BERT's initial representations for specific tasks may require optimization.

t-SNE visualization of document embeddings before task-specific fine-tuning. While USE (right) shows distinct clusters, BERT (left) exhibits a more manifold-like structure.

Fine-tuning BERT significantly improves the separability of document representations, leading to highly compact clusters that directly correlate with its superior classification accuracy.

t-SNE visualization after fine-tuning. BERT (left) achieves highly compact and distinct clusters, outperforming the separability of the Universal Sentence Encoder (right).

Key Results

BERT emerged as the most consistent performer, achieving the highest accuracy on 4 out of 6 datasets (e.g., 98.2% on BBC News). DistilBERT was a close second, even outperforming the full BERT model on the BBC Sports dataset (99.32%). Among shallow models, the BiLSTM + Max architecture was highlighted as a strong, efficient choice. Notably, on the 20 Newsgroups dataset, the gap between Naive Bayes (81.69%) and BERT (85.78%) was relatively small, reinforcing the idea that sophisticated models are not always strictly necessary for topic categorization.

Conclusion

While BERT-based models are the most consistent performers and can be used "blindly" for high performance, they are not always required. For topic-based tasks, simpler models offer a competitive and computationally efficient alternative. Future work will focus on efficient Transformer variants like Longformer or BigBird to address the quadratic memory and time dependencies of standard BERT on extremely long sequences.

Summary updated

BibTeX
@inproceedings{wagh2021comparative,
  author = {Vedangi Wagh and Snehal Ishwar Khandve and Isha Joshi and Apurva Dinesh Wani and Geetanjali Kale and Raviraj Joshi},
  title = {{Comparative Study of Long Document Classification}},
  booktitle = {TENCON},
  year = {2021},
  doi = {10.1109/tencon54134.2021.9707465},
}
Figure