BERT and cross entropy
## ❓ Questions & Help

How can I feed probability of classes to BERT as label? For example, in sentiment analysis
let say we have this sentence "I like to sleep" instead of 0 or 1 I want to label it as 0.6 negative and 0.4 positive.

Thank you in advance
Yes , you can use a MSEloss<|||||>thank you for replying me.
Can I use cross entropy Loss, since BERT use it, and replacing the one hot vector by the weight of each class?<|||||>SO, What are the labeles of classes?<|||||>1 for positive and 0 for negative<|||||>I think it may work well ,and you may use NLLloss, it will be seem as a regression problem,
You can try mse loss ,I think mse loss will have better proformence<|||||>Why "seen as a regression problem" the output still 1(positive) or 0(negative). The reason of multiplying by weight is to help the model to generalized better and avoiding overconfident .  <|||||>![CrossEntropy](https://user-images.githubusercontent.com/55197626/72849700-44b87180-3c75-11ea-933d-b619cfaf9598.PNG)
I am try to use like the in the figure (https://pytorch.org/docs/master/nn.html#crossentropyloss) and I am not sure what is the best way to pass the weight tensor to the model in order CrossEntropyLoss to use it.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
<|||||>I would suggest adding a class_weight parameter to `BertForSequenceClassification`. This should be an easy fix <|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
