token_probas = token_count / token_count.sum()
h = -torch.xlogy(token_probas, token_probas).sum()
train_set_perplexity = math.exp(h)
token_probas = token_count / token_count.sum()
h = -torch.xlogy(token_probas, token_probas).sum()
train_set_perplexity = math.exp(h)