Papers › Task-Aware Representation of Sentences for Generic Text Classification

Task-Aware Representation of Sentences for Generic Text Classification

1 Dec 2020COLING 2020 8archive 2025-07-28

Kishaloy Halder, Alan Akbik, Josip Krapac, Roland Vollgraf

State-of-the-art approaches for text classification leverage a transformer architecture with a linear layer on top that outputs a class distribution for a given prediction problem. While effective, this approach suffers from conceptual limitations that affect its utility in few-shot or zero-shot transfer learning scenarios. First, the number of classes to predict needs to be pre-defined. In a transfer learning setting, in which new classes are added to an already trained classifier, all information contained in a linear layer is therefore discarded, and a new layer is trained from scratch. Second, this approach only learns the semantics of classes implicitly from training examples, as opposed to leveraging the explicit semantic information provided by the natural language names of the classes. For instance, a classifier trained to predict the topics of news articles might have classes like {``}business{''} or {``}sports{''} that themselves carry semantic information. Extending a classifier to predict a new class named {``}politics{''} with only a handful of training examples would benefit from both leveraging the semantic information in the name of a new class and using the information contained in the already trained linear layer. This paper presents a novel formulation of text classification that addresses these limitations. It imbues the notion of the task at hand into the transformer model itself by factorizing arbitrary classification problems into a generic binary classification problem. We present experiments in few-shot and zero-shot transfer learning that show that our approach significantly outperforms previous approaches on small training data and can even learn to predict new classes with no training examples at all. The implementation of our model is publicly available at: https://github.com/flairNLP/flair.

PaperPDFCode

Code

flairNLP/flair officialmentioned in paperpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

ArticlesBinary ClassificationClassificationText ClassificationTransfer Learningtext-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Linear Layer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections