ValueError: operands could not be broadcast together with shapes (5,) (14,)

Hi and tnx for answering, i know that it see some difrent classes in every batch and make trouble in precision, but i don,t know how to solve it
The models output (qa_sinilarity) is in :

And the task is question answering by finding similarest question in dataset and by keras it obtain up yo 96% acc but in transfering the code into pytorch i face this problem,by this informations, can you help me more please?