rouge / index.html
kholdrex's picture
ROUGE metric computed with rouge-score-rs
ba9518e verified
Raw History Blame Contribute Delete
1.64 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ROUGE (rouge-score-rs)</title>
<style>
body { font-family: system-ui, -apple-system, sans-serif; max-width: 760px; margin: 40px auto; padding: 0 20px; line-height: 1.55; color: #1f2328; }
pre { background: #f6f8fa; padding: 14px 16px; border-radius: 6px; overflow-x: auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
a { color: #0969da; }
</style>
</head>
<body>
<h1>ROUGE (rouge-score-rs)</h1>
<p>An <a href="https://huggingface.co/docs/evaluate">Evaluate</a> metric with the same inputs, options and scores as
<a href="https://huggingface.co/spaces/evaluate-metric/rouge"><code>rouge</code></a>, computed with
<a href="https://pypi.org/project/rouge-score-rs/">rouge-score-rs</a>, a Rust implementation of Google's
<code>rouge-score</code>.</p>
<pre><code>pip install evaluate 'rouge-score-rs[aggregate]&gt;=0.1.1'</code></pre>
<pre><code>import evaluate
rouge = evaluate.load("SyntaxSpirits/rouge")
results = rouge.compute(
predictions=["hello there", "general kenobi"],
references=["hello there", "general kenobi"],
)
print(results) # {'rouge1': 1.0, 'rouge2': 1.0, 'rougeL': 1.0, 'rougeLsum': 1.0}</code></pre>
<p>Inputs, outputs, compatibility notes and examples are in the
<a href="https://huggingface.co/spaces/SyntaxSpirits/rouge/blob/main/README.md">metric card</a>.
Source code: <a href="https://github.com/SyntaxSpirits/rougers">SyntaxSpirits/rougers</a>.
Not affiliated with Google or Hugging Face.</p>
</body>
</html>