"vscode:/vscode.git/clone" did not exist on "56d0f08c142238457b87b2c898dbe22451f4c38a"
Commit 0033f1b6 authored by Zdenek Kasner's avatar Zdenek Kasner
Browse files

Align BLEU computation with ROUGE

parent 795b7912
...@@ -768,7 +768,7 @@ class PromptSourceTask(Task): ...@@ -768,7 +768,7 @@ class PromptSourceTask(Task):
metric in self.CONFIGURED_PS_METRICS metric in self.CONFIGURED_PS_METRICS
), "Unexpected metric. Add it, or use a task-specific solution." ), "Unexpected metric. Add it, or use a task-specific solution."
if metric == "BLEU": if metric == "BLEU":
out["bleu"] = (target, pred) out["bleu"] = metrics.bleu([(target, pred)])
if metric == "ROUGE": if metric == "ROUGE":
# TODO: This computes all rouge sub-metrics. Find a generic # TODO: This computes all rouge sub-metrics. Find a generic
# way to handle user specified rouge sub-metrics to avoid extra # way to handle user specified rouge sub-metrics to avoid extra
...@@ -819,7 +819,7 @@ class PromptSourceTask(Task): ...@@ -819,7 +819,7 @@ class PromptSourceTask(Task):
if metric == "Accuracy": if metric == "Accuracy":
out["acc"] = mean out["acc"] = mean
if metric == "BLEU": if metric == "BLEU":
out["bleu"] = metrics.bleu out["bleu"] = mean
if metric == "ROUGE": if metric == "ROUGE":
# TODO: Find a generic way to handle user specified rouge metrics. # TODO: Find a generic way to handle user specified rouge metrics.
out["rouge1_precision"] = mean out["rouge1_precision"] = mean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment