Could you provide the Dataset code and how you are calculating the weights?
I’m not an NLP expert, but I guess your sentences shouldn’t be split by the sampling, so it’s interesting to see, how you are dealing with your data generally.
Also, you might want to have a look at torchtext 38.