Using simple multiplication of word weights short sentences will have a much higher weights than longer ones, since we multiply with a number in [0, 1].
However if your sentences have a fixed length, try to create sentence weights multiplying the word weights, and see if the class frequencies are approx. equal in each batch.