0Pricing
NLP Academy · 课时

使用 ROUGE 与 BLEU 评估生成结果

衡量摘要与翻译质量

使用 ROUGE 与 BLEU 评估生成结果 是 CoddyKit 上的免费 NLP Academy 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 NLP Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 NLP Academy 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

Why Score Generation?

Summaries and translations are free-form text, so there is no single right answer. We need metrics to compare output against reference text. 📏

Compare to a Reference

Both ROUGE and BLEU compare your generated text to one or more human references. More overlap with the reference means a higher score.

BLEU for Translation

BLEU measures how many short word sequences in your output also appear in the reference. It is the classic metric for machine translation.

BLEU Rewards Precision

BLEU is precision-focused: it asks how much of your output matches the reference. A brevity penalty stops models from cheating with very short text.

ROUGE for Summaries

ROUGE is the go-to metric for summarization. It checks how much of the reference content your summary managed to recover.

ROUGE Rewards Recall

ROUGE leans on recall: did your summary capture the important words from the reference? ROUGE-1 counts single-word overlap.

ROUGE-L and Sequences

ROUGE-L looks at the longest matching word sequence, rewarding output that keeps the reference's order, not just its words.

Computing ROUGE

The evaluate library makes scoring a one-liner. Load rouge and pass your predictions with their references.

import evaluate
rouge = evaluate.load("rouge")
print(rouge.compute(predictions=preds, references=refs))

Computing BLEU

BLEU works the same way. Note each prediction needs a list of references, since several translations can be correct.

bleu = evaluate.load("bleu")
print(bleu.compute(predictions=preds, references=refs))

Higher Is Better

Both scores rise with overlap. They are useful for comparing models, but a single absolute number means little on its own.

Metrics Miss Meaning

These metrics count word overlap, not true meaning. A perfect paraphrase using different words can still score low, so pair them with human review.

Quick Check

Which metric is recall-focused and standard for summarization?

Recap

You learned to score generated text: BLEU for translation precision, ROUGE for summary recall, and why both still need human judgment. 🎯

常见问题解答

「使用 ROUGE 与 BLEU 评估生成结果」课时是免费的吗?

是的 — 「使用 ROUGE 与 BLEU 评估生成结果」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 NLP Academy 课程的其余内容,请升级到 CoddyKit PRO。 NLP Academy 课程共包含 4 节课。

「使用 ROUGE 与 BLEU 评估生成结果」这节课中我会学到什么?

衡量摘要与翻译质量 你通过在浏览器中直接运行的动手代码来练习 NLP Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 NLP Academy 需要有经验吗?

无需任何先前经验。CoddyKit 上的 NLP Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「使用 ROUGE 与 BLEU 评估生成结果」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 NLP Academy 课中编写并运行代码吗?

能。每节 NLP Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 抽取式摘要与抽象式摘要
  2. 使用 Seq2Seq 模型生成摘要
  3. 实践机器翻译
  4. 使用 ROUGE 与 BLEU 评估生成结果
← 返回 NLP Academy