Skip to content

Evaluation, diagnostics, benchmarks, and additional tests · Evaluation, diagnostics, benchmarks, and additional hypothesis tests · EVA032 · Metric

ROUGE family

Evaluates reference overlap for summaries using n-grams, longest common subsequences, and related variants.

Runs in CodeSplash Complete calculation CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through evaluate.text. The reference's example ran here in one language.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Evaluates reference overlap for summaries using n-grams, longest common subsequences, and related variants.

Question / hypotheses

How much reference content is recovered in the candidate summary under the selected overlap rule?

Architecture / computational structure

A fixed scoring/calibration pipeline applied to model outputs or supplied observations; the formula and usage sections identify its operations.

Assumptions

Declare variant, stemming, sentence segmentation, tokenization, and precision/recall/F-score choice. Multiple references and corpus aggregation affect results.

Formula / computational definition

ROUGE-Nrecall=∑gmin⁡(ccand(g),cref(g))∑gcref(g).ROUGE\text{-}N_{recall}=\frac{\sum_g\min(c_{cand}(g),c_{ref}(g))}{\sum_g c_{ref}(g)}.

Parameters and notation

g is an n-gram; ROUGE-L uses longest-common-subsequence matches. Variant and beta/aggregation settings are hyperparameters, with no learned metric parameters.

Fitting, fine-tuning, and adaptation

There is no model fine-tuning step for this evaluation procedure. Freeze the evaluated systems and evaluator before the final test. Select evaluation settings on development data; if a learned evaluator or calibration model is adapted, use separate fitting data, version it, and reassess its validity.

How to use and calibrate

Report specific variants and implementation settings, then inspect hallucinations, omitted critical facts, and redundancy. Bootstrap entire documents for paired comparisons.

Example application

Compare abstractive summarizers against human reference summaries.

Interpretation / pitfalls

Watch out

Word overlap does not establish factual consistency. Long summaries can increase recall without being better. ROUGE-L and ROUGE-Lsum use different sentence-level conventions.

Python and R code examples

Scope: Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

Validation: Python — Executed successfully on synthetic inputs. R — reviewed but not executed in this environment. Python dependencies are explicit imports; R uses base R unless a package/bridge is explicitly named.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

from collections import Counter
ref=Counter("the red cat sat".split()); hyp=Counter("the cat sat".split())
overlap=sum((ref&hyp).values()); print("ROUGE-1 recall",overlap/sum(ref.values()))
R

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

ref <- table(strsplit("the red cat sat"," ")[[1]]); hyp <- table(strsplit("the cat sat"," ")[[1]])
words <- union(names(ref),names(hyp)); a <- ref[words]; b <- hyp[words]; a[is.na(a)] <- 0; b[is.na(b)] <- 0
print(sum(pmin(a,b))/sum(a))

Sources

From the CodeSplash reference, entry EVA032.