Input

  • output (str): The generated text
  • expectedOutput (str): The reference text

Output

  • Result (float): A score between 0 and 1.

Interpretation

  • Higher scores (closer to 1): Stronger structural similarity and correct word order
  • Lower scores (closer to 0): Weak structural similarity

Formula

ROUGE-L=Length of LCSTotal number of words in the reference\mathrm{ROUGE\text{-}L} = \frac{\text{Length of LCS}}{\text{Total number of words in the reference}}

Example Calculation:

  • Reference: “the cat sat on the mat” (m = 6)
  • Candidate: “the cat lies on the rug” (n = 6)
  • LCS(X,Y) = [the, cat, on, the] → length = 4
Compute ROUGE-L using the formula: ROUGE-L=460.667\mathrm{ROUGE\text{-}L} = \frac{4}{6} \approx 0.667
This is a Similarity Metric

Use Cases

  • Evaluating abstractive summarization
  • Assessing machine translation