Problem with stratified sampling on dataframe and then convert to torchtext

is there a way to use weighted sampling or any other methods to handle a class imbalance in torchtext, I have a problem similar to this