You can find the class-weights using this link https://scikit-learn.org/stable/modules/generated/sklearn.utils.class_weight.compute_class_weight.html 2
And just to make things clear about your problem of classifier providing neutral results.
Consider a batchsize of 1.

When target is the 0th class. Loss will propogate normally.
When target is the 1st class. Loss will propogate normally.
When target is between 2nd to 9th class. How should the loss propogate ?