Skip to content

Update metric load as per v3.0.2 #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/summarization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"from evaluate import load\n",
"\n",
"raw_datasets = load_dataset(\"xsum\")\n",
"metric = load(\"rouge\")"
"rouge = load(\"rouge\")"
]
},
{
Expand Down Expand Up @@ -409,7 +409,7 @@
"id": "lnjDIuQ3IrI-"
},
"source": [
"The metric is an instance of [`datasets.Metric`](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Metric):"
"The rouge is a metric and is an instance of [`evaluate.Metric`](https://huggingface.co/docs/evaluate/main/en/package_reference/main_classes#evaluate.Metric):"
]
},
{
Expand Down Expand Up @@ -461,7 +461,7 @@
}
],
"source": [
"metric"
"rouge"
]
},
{
Expand Down Expand Up @@ -496,7 +496,7 @@
"source": [
"fake_preds = [\"hello there\", \"general kenobi\"]\n",
"fake_labels = [\"hello there\", \"general kenobi\"]\n",
"metric.compute(predictions=fake_preds, references=fake_labels)"
"rouge.compute(predictions=fake_preds, references=fake_labels)"
]
},
{
Expand Down Expand Up @@ -904,7 +904,7 @@
" \n",
" # Note that other metrics may not have a `use_aggregator` parameter\n",
" # and thus will return a list, computing a metric for each sentence.\n",
" result = metric.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True, use_aggregator=True)\n",
" result = rouge.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True, use_aggregator=True)\n",
" # Extract a few results\n",
" result = {key: value * 100 for key, value in result.items()}\n",
" \n",
Expand Down