Revisiting Transformer-based Models for Long Document Classification

Xiang Dai, Ilias Chalkidis, Sune Darkner, Desmond Elliott
4/14/2022
cs.CL
transformer-attention

Official code: coastalcph/trldc (17 stars, Python, last commit 2022-11-02).

Abstract

The recent literature in text classification is biased towards short text sequences (e.g., sentences or paragraphs). In real-world applications, multi-page multi-paragraph documents are common and they cannot be efficiently encoded by vanilla Transformer-based models.

Show full abstract

We compare different Transformer-based Long Document Classification (TrLDC) approaches that aim to mitigate the computational overhead of vanilla transformers to encode much longer text, namely sparse attention and hierarchical encoding methods. We examine several aspects of sparse attention (e.g., size of local attention window, use of global attention) and hierarchical (e.g., document splitting strategy) transformers on four document classification datasets covering different domains. We observe a clear benefit from being able to process longer text, and, based on our results, we derive practical advice of applying Transformer-based models on long document classification tasks.

View on arXivView PDF

Code Implementations(1)

coastalcph/trldcOfficial100%

Transformer-based Long Document Classification

176Python, Jupyter NotebookApr 17, 20224 years ago

Similar Papers

Cite this paper

@article{dai2022revisiting,
  title  = {Revisiting Transformer-based Models for Long Document Classification},
  author = {Xiang Dai and Ilias Chalkidis and Sune Darkner and Desmond Elliott},
  year   = {2022},
  eprint = {2204.06683},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.06683}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.06683.svg)](https://codeofpaper.com/paper/2204.06683)

Discussion