Standard metric for text summarization evaluation. Measures unigram overlap between reference and generated text.
precision = |ref ∩ hyp| / |hyp|recall = |ref ∩ hyp| / |ref|ROUGE-1 = 2 × P × R / (P + R)rouge1(reference="the cat sat on mat",
hypothesis="the cat on mat")
→ 0.88889Round to **5 decimal places**.
Similar Problems
Test Cases (2 visible · 2 hidden)
Case 1: One word missing from hyp
Input: rouge1("the cat sat on mat","the cat on mat")
Expected: 0.88889
Case 2: Perfect match
Input: rouge1("hello world","hello world")
Expected: 1.0
⌘↵ Run · ⌘⇧↵ Submit