Practice: BLEU and chrFPratique : BLEU et chrF
TRA6008 To read for S8À lire pour la S8
The exercises below use one reference translation and one output. Count the n-grams n-gramn-gramme corporacorpus A sequence of n consecutive items from a text, usually words: bigrams (n = 2), trigrams (n = 3), and so on.Suite de n éléments consécutifs d'un texte, généralement des mots : bigrammes (n = 2), trigrammes (n = 3), etc. yourself before answering; the table gives the two sentences.
| Sentence | Words | |
|---|---|---|
| Reference | The meeting starts at nine tomorrow morning | 7 |
| Output | The meeting begins at nine tomorrow morning | 7 |
What is the precision of the single words (1-grams) of the output against the reference? Give a fraction or a number rounded to two decimals.
Quelle est la précision des mots isolés (1-grammes) de la sortie par rapport à la référence ? Donnez une fraction ou un nombre arrondi à deux décimales.
Show the explanationVoir l'explication
Six of the seven words of the output are in the reference; only begins is not. The 1-gram precision is therefore 6 / 7 = 0.86.
Six des sept mots de la sortie figurent dans la référence ; seul begins n'y est pas. La précision des 1-grammes est donc 6 / 7 = 0,86.
How many pairs of consecutive words (2-grams) of the output also occur in the reference?
Combien de paires de mots consécutifs (2-grammes) de la sortie se retrouvent dans la référence ?
Show the explanationVoir l'explication
The output has six pairs: the meeting, meeting begins, begins at, at nine, nine tomorrow, tomorrow morning. The two that contain begins are not in the reference; the other four are, a 2-gram precision of 4 / 6. One changed word costs two pairs, three triples and three quadruples: that is how BLEU punishes a synonym.
La sortie compte six paires : the meeting, meeting begins, begins at, at nine, nine tomorrow, tomorrow morning. Les deux qui contiennent begins ne sont pas dans la référence ; les quatre autres y sont, soit une précision des 2-grammes de 4 / 6. Un seul mot changé coûte deux paires, trois triplets et trois quadruplets : c'est ainsi que BLEU punit un synonyme.
A third output, The meeting starts at nine, matches the reference word for word but stops after five words. What does BLEU do with it?
Une troisième sortie, The meeting starts at nine, reprend la référence mot pour mot mais s'arrête après cinq mots. Que fait BLEU de cette sortie ?
Show the solutionVoir la solution
All four precisions are 1, since every n-gram of the output is in the reference. But the output has 5 words against 7, and BLEU then multiplies the score by e(1 − 7/5) ≈ 0.67: the output scores 67, not 100. The brevity penalty stands in for recall, which BLEU does not compute.
Les quatre précisions valent 1, puisque chaque n-gramme de la sortie est dans la référence. Mais la sortie compte 5 mots contre 7, et BLEU multiplie alors le score par e(1 − 7/5) ≈ 0,67 : la sortie obtient 67, pas 100. La pénalité de brièveté remplace le rappel, que BLEU ne calcule pas.
The output The meeting begins at nine tomorrow morning scores 49 on BLEU and 78 on chrF. Which of the following outputs scores lower on BLEU and higher on chrF than it does?
La sortie The meeting begins at nine tomorrow morning obtient 49 en BLEU et 78 en chrF. Laquelle des sorties suivantes obtient un BLEU plus bas et un chrF plus haut qu'elle ?
Show the solutionVoir la solution
In The meetings start at nine tomorrow morning, two of the seven words differ from the reference (meetings, start), which costs BLEU more than a single synonym did: 43 against 49. For chrF only a few characters change (one s moves): 85 against 78. The three other outputs use only words of the reference, so their BLEU goes up (71, 67 and 85).
Dans The meetings start at nine tomorrow morning, deux mots sur sept diffèrent de la référence (meetings, start), ce qui coûte à BLEU plus qu'un seul synonyme : 43 contre 49. Pour chrF, seuls quelques caractères changent (un s déplacé) : 85 contre 78. Les trois autres propositions n'emploient que des mots de la référence, donc leur BLEU monte (71, 67 et 85).
Les exercices ci-dessous portent sur une traduction de référence et une sortie, toutes deux en anglais. Comptez vous-même les n-grammes n-gramn-gramme corporacorpus A sequence of n consecutive items from a text, usually words: bigrams (n = 2), trigrams (n = 3), and so on.Suite de n éléments consécutifs d'un texte, généralement des mots : bigrammes (n = 2), trigrammes (n = 3), etc. avant de répondre ; le tableau donne les deux phrases.
| Phrase | Mots | |
|---|---|---|
| Référence | The meeting starts at nine tomorrow morning | 7 |
| Sortie | The meeting begins at nine tomorrow morning | 7 |
What is the precision of the single words (1-grams) of the output against the reference? Give a fraction or a number rounded to two decimals.
Quelle est la précision des mots isolés (1-grammes) de la sortie par rapport à la référence ? Donnez une fraction ou un nombre arrondi à deux décimales.
Show the explanationVoir l'explication
Six of the seven words of the output are in the reference; only begins is not. The 1-gram precision is therefore 6 / 7 = 0.86.
Six des sept mots de la sortie figurent dans la référence ; seul begins n'y est pas. La précision des 1-grammes est donc 6 / 7 = 0,86.
How many pairs of consecutive words (2-grams) of the output also occur in the reference?
Combien de paires de mots consécutifs (2-grammes) de la sortie se retrouvent dans la référence ?
Show the explanationVoir l'explication
The output has six pairs: the meeting, meeting begins, begins at, at nine, nine tomorrow, tomorrow morning. The two that contain begins are not in the reference; the other four are, a 2-gram precision of 4 / 6. One changed word costs two pairs, three triples and three quadruples: that is how BLEU punishes a synonym.
La sortie compte six paires : the meeting, meeting begins, begins at, at nine, nine tomorrow, tomorrow morning. Les deux qui contiennent begins ne sont pas dans la référence ; les quatre autres y sont, soit une précision des 2-grammes de 4 / 6. Un seul mot changé coûte deux paires, trois triplets et trois quadruplets : c'est ainsi que BLEU punit un synonyme.
A third output, The meeting starts at nine, matches the reference word for word but stops after five words. What does BLEU do with it?
Une troisième sortie, The meeting starts at nine, reprend la référence mot pour mot mais s'arrête après cinq mots. Que fait BLEU de cette sortie ?
Show the solutionVoir la solution
All four precisions are 1, since every n-gram of the output is in the reference. But the output has 5 words against 7, and BLEU then multiplies the score by e(1 − 7/5) ≈ 0.67: the output scores 67, not 100. The brevity penalty stands in for recall, which BLEU does not compute.
Les quatre précisions valent 1, puisque chaque n-gramme de la sortie est dans la référence. Mais la sortie compte 5 mots contre 7, et BLEU multiplie alors le score par e(1 − 7/5) ≈ 0,67 : la sortie obtient 67, pas 100. La pénalité de brièveté remplace le rappel, que BLEU ne calcule pas.
The output The meeting begins at nine tomorrow morning scores 49 on BLEU and 78 on chrF. Which of the following outputs scores lower on BLEU and higher on chrF than it does?
La sortie The meeting begins at nine tomorrow morning obtient 49 en BLEU et 78 en chrF. Laquelle des sorties suivantes obtient un BLEU plus bas et un chrF plus haut qu'elle ?
Show the solutionVoir la solution
In The meetings start at nine tomorrow morning, two of the seven words differ from the reference (meetings, start), which costs BLEU more than a single synonym did: 43 against 49. For chrF only a few characters change (one s moves): 85 against 78. The three other outputs use only words of the reference, so their BLEU goes up (71, 67 and 85).
Dans The meetings start at nine tomorrow morning, deux mots sur sept diffèrent de la référence (meetings, start), ce qui coûte à BLEU plus qu'un seul synonyme : 43 contre 49. Pour chrF, seuls quelques caractères changent (un s déplacé) : 85 contre 78. Les trois autres propositions n'emploient que des mots de la référence, donc leur BLEU monte (71, 67 et 85).
Sources
- Papineni, K., Roukos, S., Ward, T., & Zhu, W.-J. (2002). BLEU: a method for automatic evaluation of machine translation. Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics (ACL 2002), Philadelphia, 311–318. https://doi.org/10.3115/1073083.1073135
- Popović, M. (2015). chrF: character n-gram F-score for automatic MT evaluation. Proceedings of the Tenth Workshop on Statistical Machine Translation (WMT 2015), Lisbon, 392–395. https://doi.org/10.18653/v1/W15-3049
Sources
- Papineni, K., Roukos, S., Ward, T., & Zhu, W.-J. (2002). BLEU: a method for automatic evaluation of machine translation. Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics (ACL 2002), Philadelphia, 311–318. https://doi.org/10.3115/1073083.1073135
- Popović, M. (2015). chrF: character n-gram F-score for automatic MT evaluation. Proceedings of the Tenth Workshop on Statistical Machine Translation (WMT 2015), Lisbon, 392–395. https://doi.org/10.18653/v1/W15-3049