Parallel Data Mining and Quality Control › Quality Control

Michael BrenndoerferNovember 26, 20267 min read
Language AI HandbookAll chapters
Part 27 of 67Machine Translation and Speech Translation
Chapter 192Parallel Data Mining and Quality Control › Quality Control
Reading section 6 of 14 · Quality Control · 7 minSection 6 of 14 · 7 min

Section 6 of 14 · 7 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

This section compares six available quality signals. Choose checks according to the errors you see on labeled pairs and the compute budget you can measure.

A length ratio can flag a truncated segment, language identification can flag a wrong language, and a language model can flag unusual text. Bilingual similarity, quality estimation, and round-trip comparison offer additional clues about adequacy. Their cost and usefulness depend on the implementation and on the kinds of mistakes in the candidate pool.

Length ratio

A length-ratio check compares both sides in one chosen unit, such as words or characters. Compute the ratio for nonempty sources:

ρ=∣t∣∣s∣\rho = \frac{|t|}{|s|}

where:

  • ∣t∣|t|: the number of words (or characters) on the target side
  • ∣s∣|s|: the number of words (or characters) on the source side
  • ρ\rho: the length ratio of the pair

Treat very short or very long targets as candidates for inspection. Set the accepted range using labeled examples from the language pair and the same definition of length you will use in production.

Count the same kind of unit on both sides and state which tokenizer or character convention you use. A whitespace count will miss word boundaries in text that does not mark them with spaces.

A two-word target for a 20-word source yields a ratio of 0.1. A 100-word target for a five-word source yields 20. A concise but adequate translation can also have an extreme ratio, so sample rejected pairs before imposing a hard cutoff.

Calculating the ratio needs the chosen token or character counts and a division. Run it before expensive models when audits show it removes enough invalid pairs without discarding the examples you need.

Language identification

A page labeled Portuguese can contain Spanish sentences. Sentence-level language identification can flag those cases. Candidate detectors include the fastText lid.176 models and CLD3. fastText language-identification models · CLD3 project

  • Identify the dominant language of each side.
  • Keep the pair only if the source is detected as LsL_s and the target as LtL_t.
  • For code-switched or mixed-language documents, use a lower confidence threshold or skip the filter entirely.

Short inputs give the classifier little evidence. Inspect error rates by length and language before changing your cutoff. Part XX, Ch 3: Language Identification

A short interjection can occur in texts in several languages. Mixed-language inputs and closely related languages deserve separate checks of language-ID error rates. You can route ambiguous cases to other checks instead of assuming that a single language label is correct.

Language model fluency

A language model can flag text that is unusual under the model for the expected language. For a nonempty sequence of LL tokens, compute per-token perplexity:

PPL⁡(t)=exp⁡(−1L∑k=1Llog⁡P(tk∣t<k)).\operatorname{PPL}(t)=\exp\left(-\frac{1}{L}\sum_{k=1}^{L}\log P(t_k\mid t_{<k})\right).

Here P(tk∣t<k)P(t_k\mid t_{<k}) is the model probability of token kk given the preceding tokens. The exponent is mean negative log probability using natural logs. Perplexity is the reciprocal of the geometric mean token probability, so higher perplexity means lower probability under the model. For token probabilities 0.50.5 and 0.1250.125, the geometric mean is 0.250.25 and perplexity is 44.

Unusual domain vocabulary can have high perplexity even in fluent text. Calibrate by language, tokenizer, and domain. Fluency also gives no assurance of translation adequacy, so use a separate bilingual signal.

Cross-lingual similarity

An absolute cosine floor can remove a pair with a weak similarity score even when few competing neighbors give it a good margin. Inspect examples rejected by this additional check.

Treat the mining margin and the absolute QC cosine as separate scores. Sweep both cutoffs on labeled candidates from the exact encoder, language pair, and domain you will use.

A filter only selects from pairs retrieval supplies. A recall-oriented retrieval stage leaves more candidates to check, while a later cosine floor can reject weak matches. Measure the effect on both recall and precision before choosing the two cutoffs.

Quality estimation models

Reference-free quality estimation scores a hypothesis given its source. COMETKiwi is one example. Its joint encoder reads the source and hypothesis together. COMETKiwi system paper

  1. Score every pair with a QE model.
  2. Convert scores to a percentile within the batch.
  3. Keep the top pp proportion of pairs, where pp depends on the data budget.

Choose a batch-relative share when the retained count is a fixed budget. Round the requested count and break ties consistently if you need exactly that many rows. The score cutoff and resulting precision can change with the batch composition.

Check whether QE improves the decisions on pairs that pass cheaper filters, for example by flagging omissions or additions. Measure inference before running the model on the full candidate pool.

A joint encoder can batch several source–hypothesis pairs. Each score still depends on both inputs, so an index of separately cached sentence vectors cannot reproduce that inference. A retrieval stage can narrow the candidates before the joint model scores them.

Round-trip translation

A backward reconstruction check can help assess an existing mined pair. Take a candidate pair (s,t)(s, t). Translate tt back to the source language using a backward model Mt→sM_{t \to s}:

s^=Mt→s(t)\hat{s} = M_{t \to s}(t)

Then score ss against s^\hat{s} with an automatic metric (BLEU, chrF, or the same multilingual encoder). Pairs with low round-trip scores are rejected.

This comparison needs no target-language reference. A backward model can turn a valid target into a poor source reconstruction or turn a wrong target into a plausible one. Check which errors occur before using the score as a filter.

Consider a correct translation with a poor reconstruction and an incorrect translation whose error the backward model reverses. A high round-trip score is neither necessary nor sufficient for adequacy. Measure whether a round-trip check adds information beyond your other scores.

Quality estimation (QE)

Quality estimation predicts translation quality without a target-language reference. A system can use handcrafted features or a learned source–hypothesis representation. Compare its scores with task-specific human judgments before using a cutoff.

Putting the filters together

A realistic pipeline composes filters in order of cost:

  1. Cheap heuristics. Length ratio, punctuation match, number match, script match.
  2. Language ID. Reject wrong-language sentences.
  3. Embedding similarity. Reject pairs below a cosine threshold.
  4. Margin filter. Reject pairs that fail the margin criterion.
  5. LM scores. Reject pairs with very low fluency in either language.
  6. QE models. Reject low-scoring survivors.
  7. Contamination check. Remove pairs that overlap with the evaluation set.

Run inexpensive checks first so expensive QE models see fewer candidates. The figure uses constructed counts to show the change in scale between selected stages of the funnel.

The funnel is easiest to grasp as a sequence of attrition points.

VisualizationOut [6]
CollapseExpand
Four horizontal bars decrease from raw candidates to the checkpoint after quality estimation.
Illustrative candidate counts at four checkpoints. The logarithmic axis makes the change from one billion to ten million pairs visible.

Numbers, dates, and punctuation can flag misalignment. Their surface forms can also change across languages, as when a translation writes a number in words or localizes a date. Audit examples before making a mismatch an automatic rejection.

The funnel can leave stylistically mismatched pairs or targets that are plausible sentences but change the source meaning. Review a sample of accepted pairs to learn which errors the checks miss.

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy