[Question]: TextClassifier question
Author: alejandrojcastaneiraCreated Jul 25, 2025Updated May 23, 2026
Labelsquestion
Question
Hi everyone, is there a way to perform binary classification with the TextClassifier? I have a dataset with only two classes, positive and negative, and I'm loading the corpus as a .CSV file with the following format: "text" , "label", the label can be either 0 or 1. However, the label dictionary creates two separate classes, and training begins in this manner.
After fine-tuning, the model starts predicting these two classes separately. Sometimes, a single sentence can be both, which I assume is due to the Crossentropy loss used. How can I format the training data or modify the classifier to change this behaviour? Also, would it be possible to train with BinaryCrossentropy?
Source: flairNLP/flair