-
With reference to the given example in this notebook, would it be possible to demonstrate how perplexity can be calculated with There is also perplexity implemented in TorchMetrics, but it seems to take the log probabilities and ground truth values, different to the example you have provided. |
Beta Was this translation helpful? Give feedback.
Answered by
d-kleine
Jun 20, 2023
Replies: 1 comment 7 replies
-
Good suggestions! As far as I know, NLTK doesn't implement perplexity functions ... Torchmetrics does though. I added an example and the results are pretty close. I wonder if the discrepancy is due to rounding error. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much - great work, looks fine now! 👍 😃
From my point of view, the
TorchMetrics
example has significantly improved the content, I now have a much better understanding how perplexity can be calculated when implementing in practice! 🏆