Evaluating text generation: BLEU, chrF, ROUGE, BERTScore and human evaluation

Evaluating Text Generation: BLEU, chrF, ROUGE, BERTScore and Human Evaluation

The difficulty of evaluating generated text, then overlap-based metrics (BLEU with a full calculation, chrF, which suits Arabic, and ROUGE for summarization), learned metrics (BERTScore and COMET), perplexity, human evaluation and its design, and the limits of each metric.

Lesson 32 of 38Intermediate45 minutes

Lesson objectives

  • Compute BLEU for a small example step by step.
  • Explain why chrF suits morphologically rich languages.
  • Design a methodologically sound human evaluation.
Page contents
  1. Why is evaluation hard?
  2. BLEU
  3. chrF
  4. ROUGE
  5. Learned metrics
  6. Perplexity
  7. Human evaluation
  8. Selection summary

Why is evaluation hard?

In classification there is one correct answer. In generation there are many correct translations and summaries with different wording. Every automatic metric approximates a human judgment of several aspects: adequacy, fluency, faithfulness to the source, and style.

BLEU

Papineni et al. (2002) proposed BLEU for machine translation. It is based on the modified precision of n-grams (n = 1..4) between the candidate translation and the references, with clipped counts: a word is not counted more times than the maximum number of times it appears in any reference.

p_n = \frac{\sum_{g \in \text{n-grams}(c)} \min\left(\text{Count}_c(g),\ \max_{r} \text{Count}_r(g)\right)}{\sum_{g \in \text{n-grams}(c)} \text{Count}_c(g)}

Because precision alone rewards short translations, a brevity penalty is added:

\text{BP} = \begin{cases} 1 & c > r \\ e^{1 - r/c} & c \le r \end{cases}, \qquad \text{BLEU} = \text{BP} \cdot \exp\left( \sum_{n=1}^{4} \tfrac{1}{4} \log p_n \right)

where c is the candidate length and r the reference length (at the corpus level).

A small example

  • Reference: «ذهب الطالب إلى المكتبة صباحا» (the student went to the library in the morning; 5 words)
  • Candidate: «ذهب الطالب الى المكتبة» (4 words, without the hamza in «الى»)
  • Unigrams: ذهب ✓, الطالب ✓, الى ✗, المكتبة ✓ → p_1 = 3/4.
  • Bigrams: (ذهب الطالب) ✓, (الطالب الى) ✗, (الى المكتبة) ✗ → p_2 = 1/3.
  • Trigrams: no match → p_3 = 0, so BLEU becomes zero at the sentence level.

The example shows two things: (1) BLEU is designed for the corpus level, not the sentence level (it needs smoothing at the sentence level), and (2) a small spelling difference (the hamza) broke the match, so normalization strongly affects BLEU in Arabic. If we normalized the hamza, we would get p_1 = 4/4, p_2 = 3/3, p_3 = 2/2 and p_4 = 1/1, and BLEU = BP = e^{1 - 5/4} \approx 0.78.

Reporting BLEU clearly

Post (2018) showed that BLEU numbers in papers are often not comparable because tokenization and normalization differ, and proposed SacreBLEU, which computes the metric in a standard way and prints a "signature" describing the settings. Always use it and report the signature.

chrF

Popović (2015) proposed chrF: an F-score over character n-grams (usually up to 6):

\text{chrF}_\beta = (1 + \beta^2)\, \frac{\text{chrP} \cdot \text{chrR}}{\beta^2\, \text{chrP} + \text{chrR}}

with \beta = 2 (weighting recall). Because it works at the character level, “والكتاب” gets partial credit against “الكتاب”, so it correlates with human judgments better than BLEU in morphologically rich languages such as Arabic. chrF++ adds word unigrams and bigrams.

ROUGE

Lin (2004) designed ROUGE for summarization; it is recall-oriented:

  • ROUGE-N: the recall of the reference n-grams in the generated summary (ROUGE-1, ROUGE-2).
  • ROUGE-L: based on the longest common subsequence (LCS) between the candidate and the reference, so it rewards order without requiring adjacency.

A note for Arabic: the original ROUGE packages are built for English and may drop non-Latin characters during tokenization if not configured, giving meaningless numbers. Make sure the tokenizer handles Arabic, and apply the same normalization to the candidate and the reference.

Learned metrics

  • BERTScore (Zhang et al., 2020): matches each token in the candidate to the closest token in the reference using contextual representations and cosine, so it rewards synonyms and paraphrases. A multilingual or Arabic model is used for Arabic.
  • COMET (Rei et al., 2020): a model trained on human judgments of translation, taking the source, the candidate and the reference. It correlates clearly better with human judgment than BLEU, but it inherits the biases of its training data, and its performance depends on its coverage of the language pair.

Perplexity

Suitable for evaluating the language model itself, not its outputs. Only compare models with the same vocabulary.

Human evaluation

The most important reference, but it needs design:

  1. Clear criteria: adequacy, fluency and faithfulness, each separately, on a defined scale (e.g. 1–5 with descriptions for each score) or pairwise comparisons (which of the two outputs is better?), which are more consistent.
  2. Blind evaluation: the rater does not know which system produced the text, and the display order is random.
  3. Qualified raters (native speakers, and from the relevant dialect when needed).
  4. Inter-rater agreement: compute and report kappa or Krippendorff's alpha.
  5. A sufficient sample size and a significance test.

Selection summary

TaskSuggested automatic metricsNotes
Translation into ArabicchrF, COMET, and BLEU via SacreBLEU for historical comparisonNormalize carefully and report the settings
SummarisationROUGE-1/2/L with an Arabic tokenizer, BERTScore, and a faithfulness checkAn abstractive summary may be correct with different words
Dialogue and assistantsHuman evaluation, or an "LLM judge" with human verificationSee the lesson on evaluating large models

Lesson summary

  • BLEU is an n-gram precision metric with a brevity penalty, computed at the corpus level.
  • chrF relies on character n-grams, so it gives partial credit to different morphological forms.
  • Automatic metrics are approximations, and a well-designed human evaluation is the reference.

Check what you understood

Choose an answer for each question to see the correction and the reasoning. Your answers are not sent anywhere.

  1. Why does chrF suit Arabic better than word-level BLEU?

  2. What is the role of the brevity penalty in BLEU?

References

  1. Papineni, K. et al. (2002). BLEU: a Method for Automatic Evaluation of Machine Translation. ACL aclanthology.org/P02-1040/
  2. Popović, M. (2015). chrF: character n-gram F-score for automatic MT evaluation. WMT aclanthology.org/W15-3049/
  3. Lin, C.-Y. (2004). ROUGE: A Package for Automatic Evaluation of Summaries. ACL Workshop aclanthology.org/W04-1013/
  4. Post, M. (2018). A Call for Clarity in Reporting BLEU Scores. WMT aclanthology.org/W18-6319/
  5. Zhang, T. et al. (2020). BERTScore: Evaluating Text Generation with BERT. ICLR arxiv.org/abs/1904.09675
  6. Rei, R. et al. (2020). COMET: A Neural Framework for MT Evaluation. EMNLP arxiv.org/abs/2009.09025