induwara.lk
induwara.lkAI · Machine Translation

NIST Score Calculator

Paste a candidate translation and one or more references to get the NIST score, the information-weighted precision for each n-gram order 1–5, the NIST brevity penalty, and a match inspector that shows every n-gram's information weight — so you can see exactly how the number was derived. Matches NLTK sentence_nist, no signup, runs in your browser.

By Induwara AshinsanaUpdated Jul 13, 2026
NIST Score
One sentence. Stays on your device.0 words
At least one. Stays on your device.0 words
Max n-gram (N)
Examples
NIST-5
Precision sum
Brevity penalty
Candidate length

Runs entirely in your browser — your text is never uploaded, logged, or stored. Method: information-weighted n-gram precision summed over orders 1–N with the NIST brevity penalty, per Doddington (2002); reconciled to NLTK sentence_nist. Up to 50,000 characters per box.

How it works

NIST is the information-weighted cousin of BLEU, introduced by George Doddington (2002) for the NIST machine-translation evaluations. Like BLEU it compares a system's output (the candidate) against one or more correct referencetexts, but it makes two changes that address BLEU's known weaknesses. The final score is:

NIST = ( Σ scoreₙ, n = 1…N ) · BP

  1. Information weights. Every reference n-gram gets a weight measuring how much information it carries: Info(w₁…wₙ) = log₂( count(w₁…w_{n-1}) ÷ count(w₁…wₙ) ). The counts are taken over the reference set. For a unigram the prefix is empty, so the numerator is the total number of reference n-grams. A predictable word (one that almost always follows its prefix) scores near 0; a rare, surprising word scores high. This is what makes NIST reward content words over function words.
  2. Information-weighted precision per order.For each order n from 1 to N, the tool sums the information weight of every candidate n-gram that also appears in a reference (clipped to the reference's count), then divides by the number of candidate n-grams of that order: scoreₙ = Σ Info(matched) ÷ (candidate n-grams). With several references, the reference giving the largest weighted match is used for that order.
  3. Sum, don't average. BLEU takes the geometric mean of its precisions, so a single order with no match forces the whole score to 0. NIST simply adds the per-order scores, so a missing 4-gram only means that order contributes nothing — the lower orders still count. This is why NIST is more stable on short sentences.
  4. Brevity penalty. With Lsys the candidate length and Lref the (accumulated) reference length, and ratio = Lsys / Lref: BP = exp( β · (ln ratio)² ) when the candidate is shorter than the reference, and BP = 1 when it is at least as long. β = ln(0.5) ÷ (ln 1.5)² ≈ −4.216 is fixed so the penalty is exactly 0.5 at a two-thirds length ratio, matching mteval-v13a.

The brevity penalty is computed two independent ways — the mteval piecewise function and the closed-form β formula — and flagged “cross-checked” when they agree. The numbers reconcile with NLTK's sentence_nist when the tokenisation matches. Because NIST is unbounded and shifts with N and the reference count, always report it together with those settings.

Worked examples

One substitution, NIST-1 → 1.8208

Candidate
the cat sat on the rug
Reference
the cat sat on the mat
  1. Reference 'the cat sat on the mat': 6 tokens, 'the' ×2
  2. Info(the) = log2(6/2) = 1.5850; Info(cat/sat/on/mat) = log2(6/1) = 2.5850
  3. Matched: the ×2, cat, sat, on ('rug' has no match)
  4. info sum = 2·1.5850 + 3·2.5850 = 10.9248; ÷ 6 candidate words = 1.8208
  5. Lsys = 6, Lref = 6 → ratio 1 → BP = 1
  6. NIST-1 = 1.8208 × 1 = 1.8208

Too short, NIST-1 → 0.2970 (BP bites)

Candidate
the cat sat
Reference
the cat sat on the mat
  1. Matched: the, cat, sat → info sum = 1.5850 + 2.5850 + 2.5850 = 6.7549
  2. ÷ 3 candidate words → score1 = 2.2516
  3. Lsys = 3, Lref = 6 → ratio 0.5
  4. BP = exp(−4.216 · (ln 0.5)²) = exp(−2.0257) = 0.1319
  5. NIST-1 = 2.2516 × 0.1319 = 0.2970
  6. Lower than the substitution case despite three exact matches — the brevity penalty is the point

Perfect match, NIST-5 → 4.3886

Candidate
the cat sat on the mat
Reference
the cat sat on the mat
  1. N = 5, so totalRefWords = 6+5+4+3+2 = 20
  2. score1 = (2·log2(20/2) + 4·log2(20/1)) / 6 = 23.9316 / 6 = 3.9886
  3. score2 = (Info('the cat') + Info('the mat')) / 5 = (1 + 1) / 5 = 0.4000
  4. score3 = score4 = score5 = 0 (every higher n-gram is fully predictable → weight 0)
  5. BP = 1 (identical lengths)
  6. NIST-5 = 3.9886 + 0.4000 = 4.3886 — note it exceeds 1, as NIST is uncapped

Frequently asked questions

Sources & references

The formulas and the worked examples on this page were last reconciled against Doddington (2002) and NLTK sentence_nist on 2026-07-13. The calculation module ships with a built-in assertion that re-runs every worked example, so a regression in the NIST math fails fast.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.