Note that one-hot encoding a target token means creating the weight vector of length |V| assigning 1 for the target label and 0 for the rest. Yet we might choose the label weight of the token to be inversely proportional to its occurrences in the batch. Also, recall that padding token _ should be ignored, so its label weight will be assigned to 0.