github.com
https://github.com/huggingface/evaluate/blob/main/metrics/perplexity/perplexity.py
Perplexity - a Hugging Face Space by evaluate-metric
Perplexity (PPL) is one of the most common metrics for evaluating language models. It is defined as the exponentiated average negative log-likelihood of a sequence, calculated with exponent base `e...
https://huggingface.co/spaces/evaluate-metric/perplexity

Seonglae Cho