Translation Evaluation Beyond BLEU › A Controlled Experiment: Which Metric Sees Which Error?
Language AI HandbookAll chapters We apply specified edits to eight French–English examples and assign each edit type a penalty. These are synthetic targets. They describe the intended edit, and other aspects of the text can also change.
The data
Eight parallel segments in French and English, with one reviewable term per segment for five of them and at least one numeral in five of them.
PythonIn [18]Expand
DATA = [
{
"source": "Le gouvernement a annoncé mardi une nouvelle politique de soutien aux énergies renouvelables.",
"reference": "The government announced on Tuesday a new policy to support renewable energy.",
"term": "renewable energy",
"term_violation": "clean power",
},
{
"source": "Les chercheurs ont découvert que 8 heures de sommeil sont essentielles pour la mémoire à long terme.",
"reference": "Researchers have discovered that 8 hours of sleep is essential for long-term memory.",
"term": "long-term memory",
"term_violation": "lasting memory",
},
{
"source": "La société prévoit d'ouvrir 3 nouveaux bureaux à Berlin au cours de l'année prochaine.",
"reference": "The company plans to open 3 new offices in Berlin next calendar year.",
"term": None,
"term_violation": None,
},
{
"source": "Selon le rapport, les émissions de CO2 ont diminué de 4 % depuis 2019.",
"reference": "According to the report, CO2 emissions have fallen by 4% since 2019.",
"term": "CO2 emissions",
"term_violation": "carbon output",
},
{
"source": "Le musée rouvrira ses portes au public le 12 septembre après deux ans de travaux.",
"reference": "The museum will reopen to the public on September 12 after two years of renovation.",
"term": None,
"term_violation": None,
},
{
"source": "Cette méthode permet de réduire le temps de calcul de moitié sans perte de précision.",
"reference": "This method cuts the computation time in half without any loss of accuracy.",
"term": "accuracy",
"term_violation": "precision",
},
{
"source": "Les négociations entre les deux pays ont repris lundi après une pause de 6 mois.",
"reference": "Negotiations between the two countries resumed on Monday after a 6-month pause.",
"term": None,
"term_violation": None,
},
{
"source": "Le conseil d'administration a rejeté l'offre de rachat lors de sa réunion extraordinaire.",
"reference": "The board of directors rejected the takeover offer at its extraordinary meeting.",
"term": "board of directors",
"term_violation": "management team",
},
]The perturbations
Each variant receives a label and weight for the intended edit. The reference and paraphrase variants are assigned zero penalty. Some glossary substitutions also change reference or grammar. The truncation operator intentionally cuts the final four words and can leave a fragment or remove a numeral or term.
PythonIn [19]Expand
SYNONYMS = {
"announced": "unveiled",
"discovered": "found",
"plans": "intends",
"fallen": "dropped",
"reopen": "open its doors again",
"cuts": "reduces",
"resumed": "picked up again",
"rejected": "turned down",
}
def paraphrase(text):
"""A legitimate alternative translation: no error, different wording."""
for word, syn in SYNONYMS.items():
pattern = re.compile(rf"\b{word}\b", re.IGNORECASE)
if pattern.search(text):
return pattern.sub(syn, text, count=1)
return text
def drop_tail(text, n=4):
"""Accuracy/Omission: remove the final words, which may include a partial clause."""
return " ".join(text.split()[:-n])
def add_clause(text):
"""Accuracy/Addition: fabricated content not present in the source."""
return text + " Analysts expect further changes soon."
def duplicate_word(text):
"""Fluency/Grammar: a repeated token."""
toks = text.split()
i = min(3, len(toks) - 1)
return " ".join(toks[:i] + [toks[i]] + toks[i:])
def strip_period(text):
"""Fluency/Punctuation: missing final punctuation."""
return text.rstrip(".")
NUM_RE = re.compile(r"(?<![A-Za-z0-9])[0-9]+(?![A-Za-z0-9])")
def corrupt_number(text):
"""Accuracy/Mistranslation: a changed numeral. Returns None if no numeral exists."""
m = NUM_RE.search(text)
if not m:
return None
return text[: m.start()] + str(int(m.group()) + 1) + text[m.end() :]
for item in DATA:
assert paraphrase(item["reference"]) != item["reference"]If none of the synonym keys matches a reference, the helper returns it unchanged. The assertion catches that case so every reference has a distinct paraphrase variant.
Building the test set
PythonIn [20]Expand
VARIANTS = [
("good", "none", 0.0),
("paraphrase", "none", 0.0),
("punct", "Fluency/Punctuation", 1.0),
("dup", "Fluency/Grammar", 1.0),
("omit", "Accuracy/Omission", 5.0),
("add", "Accuracy/Addition", 5.0),
("num", "Accuracy/Mistranslation", 5.0),
("term", "Terminology", 5.0),
]
rows = []
for seg_id, item in enumerate(DATA):
ref = item["reference"]
for kind, category, penalty in VARIANTS:
if kind == "good":
hyp = ref
elif kind == "paraphrase":
hyp = paraphrase(ref)
elif kind == "punct":
hyp = strip_period(ref)
elif kind == "dup":
hyp = duplicate_word(ref)
elif kind == "omit":
hyp = drop_tail(ref, n=4)
elif kind == "add":
hyp = add_clause(ref)
elif kind == "num":
hyp = corrupt_number(ref)
elif kind == "term":
if item["term"] is None:
continue
hyp = ref.replace(item["term"], item["term_violation"])
if hyp is None:
continue
rows.append(
{
"seg_id": seg_id,
"kind": kind,
"category": category,
"penalty": penalty,
"source": item["source"],
"reference": ref,
"hyp": hyp,
"term": item["term"],
}
)
df = pd.DataFrame(rows)
print(f"{len(df)} variants across {df['seg_id'].nunique()} source segments")Scoring: metrics and MQM
PythonIn [21]Expand
def sentence_scores(hyp, ref):
return {
"bleu": bleu_metric.sentence_score(hyp, [ref]).score,
"chrf": chrf_metric.sentence_score(hyp, [ref]).score,
"ter": ter_metric.sentence_score(hyp, [ref]).score,
}
scored = [sentence_scores(h, r) for h, r in zip(df["hyp"], df["reference"])]
df = pd.concat([df, pd.DataFrame(scored)], axis=1)
# MQM: penalties normalized by reference length, clipped at zero
df["ref_words"] = df["reference"].str.split().str.len()
df["mqm"] = (100 * (1 - df["penalty"] / df["ref_words"])).clip(lower=0)ConsoleOut [22]Expand
bleu chrf ter mqm kind good 100.00 100.00 0.00 100.00 paraphrase 76.12 86.73 13.51 100.00 punct 92.70 97.53 7.88 92.12 dup 86.06 98.03 7.88 92.12 omit 54.46 69.37 31.54 60.58 add 67.77 90.77 39.42 60.58 term 76.27 80.44 14.74 59.62 num 79.62 92.92 7.74 61.28
The reference copies have BLEU and chrF++ of 100 and TER of zero. The paraphrases retain a constructed quality score of 100 and average 76.12 sentence BLEU across the eight reference-paraphrase pairs.
The term-violation variants average 59.62 on the toy quality score, a drop of about 40.4 points. Their five references have 12 or 13 whitespace-delimited words, so a five-point error weight has a large effect after normalization. Mean sentence BLEU drops by about 23.7 points. TER is an error rate, so lower values indicate fewer edits to the reference. In this table every edited category has a higher mean TER than the reference copies.
The following chart compares the two score columns across the constructed variants.
VisualizationOut [23]Expand

Compare both bars with the unedited baseline. These differences describe the specific edits and assigned penalties in this fixture. Some edit types affect several language properties at once.
How do the automatic signals relate to the assigned quality scores?
The next cell computes Spearman correlations among the automatic signals and the assigned quality scores. The number feature checks recall on distinct digit strings. The glossary feature matches the approved phrase at word boundaries. Each feature returns 1 when no relevant number or term applies, so 1 means no detected violation.
VisualizationOut [25]Expand

BLEU and chrF++ correlate positively with the assigned scores (Spearman’s is 0.68 and 0.53), while TER correlates negatively (). The two overlap metrics also correlate with each other (). The toy number check can miss extra numbers or a number attached to the wrong entity. Plain substring matching would also count accuracy inside inaccuracy. This code checks word boundaries, but a production glossary needs language-specific inflection handling and alignment to the applicable source term.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!