Imbalanced Dataset (Transformers): How to Decide on Class Weights?
I am not sure about the model you are using but I might explain what the procedure is for ML in general. You have three &quot;vanilla&quot; solutions for coping with unbalanced supervised dataset.

Reweighing class label so that there is the same number (calculated as sum of weights for given label) of samples per label. For example if a label with maximum number of samples has $n_{max}$ samples, and some other class has $n_i$ samples, then you would assign a weight $w_i=\frac{n_{max}}{n_i}$.
Undersampling - a basic procedure that gets rids of all the additional samples so that you end up with a balanced dataset.
Oversampling - creating copies of the unbalanced classes (with less samples than the $n_{max}$)
Hope that helps,

Max