Multilabel textcat (transformers): Weights for classes in loss function (Unbalanced data) #7256
Answered
by
svlandeg
hp52
asked this question in
Help: Coding & Implementations
-
Hi, I'm training a multilabel text classificator with transformers and Spacy 3.0. My data is quite unbalanced, so I'd like to work with loss weights for the different classes. Is it possible to define custom weights that will be used in the loss function? Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Answered by
svlandeg
Mar 2, 2021
Replies: 1 comment 12 replies
-
I think right now, the only way to accomplish that, is to create a new subclass of the |
Beta Was this translation helpful? Give feedback.
12 replies
Answer selected by
svlandeg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think right now, the only way to accomplish that, is to create a new subclass of the
MultiLabel_TextCategorizer
object and reimplement theget_loss
function (note that this function is defined by the classTextCategorizer
)