How do I do multi Class (multi head) classification?

I want to use BERT models to do multi Class (multi head) classification. I have text and want to do a binary classification for churn and one binary classification for sentiment.

Is that possible “out of the box”? Or do I have to develop my own “BertForSequenceClassification” Class?


This is all in the loss function, so you can definitely use BertForSequenceClassification with two labels, then use the proper loss function (probably BCEWithLogitsLoss).

1 Like