Only keep the active part mof the loss for token classification
If attention mask is not none, then we want to restrict our loss to the items which are not padding (hereby assumed those that have attention_mask = 1). This is important if doing e.g NER.
Thanks Thibault!