Skip to content

Instantly share code, notes, and snippets.

@luisjunco
Created August 4, 2026 07:00
Show Gist options
  • Select an option

  • Save luisjunco/f0a72e11f1b7229360c9dae09c9c19c7 to your computer and use it in GitHub Desktop.

Select an option

Save luisjunco/f0a72e11f1b7229360c9dae09c9c19c7 to your computer and use it in GitHub Desktop.
Exercise NLP Evaluation Metrics (BLEU, ROUGE, LLM-as-a-judge)

NLP Evaluation Metrics


1. Intro to BLEU (machine translation)

Watch this video:


2. Implementing BLEU

Follow and understand this notebook:

Note:

  • While you follow this notebook, make sure to adapt it for your own mother tongue (you'll need to update the variable reference_translations, and a parameter tgt_lang)

3. Advantages and limitations of BLEU

Discuss and/or Research:

  • What are the advantages of BLEU?
  • What are the limitations?
  • Do some research about common alternatives (for each of them, consider its advantages and limitations)

4. Implement a solution with LLM-as-a-judge

  • Implement a solution to evaluate the model facebook/nllb-200-distilled-600M, with LLM-as-a-judge

    • Note: if you want, you can do this vibe coding, but make sure to understand in detail how it works.
  • Run the tests, and analyze the results.


Bonus: understanding ROUGE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment