Working with text classifiers that require little to no training data
When mentioning Flair and its strengths in the previous chapters, we mainly focused on various powerful ways of solving sequence labeling tasks. When talking about text classification, however, Flair was generally presented as a decent text classification tool, although nothing special compared to its sequence labeling capabilities. This was indeed the case – until now. Flair recently introduced a novel text classification method called TARS. The concept is described in depth in the Task-Aware Representation of Sentences for Generic Text Classification paper available at https://aclanthology.org/2020.coling-main.285/, which is well worth a read.
Transformer-based text classifiers in Flair leverage a special linear layer on top of the transformer model to produce the class probability distributions. The first problem with this approach is that when new class labels are introduced to the problem, or when...