From 2dad7424b22007beeb5d932c41c1799d141eb7de Mon Sep 17 00:00:00 2001 From: sahitya-pavurala Date: Wed, 30 Oct 2024 23:00:42 -0400 Subject: [PATCH 1/2] Update metric load as per v3.0.2 --- examples/summarization.ipynb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/summarization.ipynb b/examples/summarization.ipynb index 75e3d0ea..6aaf8ed3 100644 --- a/examples/summarization.ipynb +++ b/examples/summarization.ipynb @@ -179,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "id": "IreSlFmlIrIm" }, @@ -213,7 +213,7 @@ "from evaluate import load\n", "\n", "raw_datasets = load_dataset(\"xsum\")\n", - "metric = load(\"rouge\")" + "rouge = load(\"rouge\")" ] }, { @@ -409,12 +409,12 @@ "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):" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": { "id": "5o4rUteaIrI_", "outputId": "18038ef5-554c-45c5-e00a-133b02ec10f1" @@ -461,7 +461,7 @@ } ], "source": [ - "metric" + "rouge" ] }, { @@ -476,7 +476,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": { "id": "6XN1Rq0aIrJC", "outputId": "a4405435-a8a9-41ff-9f79-a13077b587c7" @@ -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)" ] }, { @@ -882,7 +882,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "metadata": { "id": "UmvbnJ9JIrJd" }, @@ -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", From 575d6e13e1b8f4fbf05a203208a2f3c45546c87b Mon Sep 17 00:00:00 2001 From: sahitya-pavurala Date: Wed, 30 Oct 2024 23:16:11 -0400 Subject: [PATCH 2/2] revert unwanted chnages --- examples/summarization.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/summarization.ipynb b/examples/summarization.ipynb index 6aaf8ed3..454bbf53 100644 --- a/examples/summarization.ipynb +++ b/examples/summarization.ipynb @@ -179,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "id": "IreSlFmlIrIm" }, @@ -414,7 +414,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": { "id": "5o4rUteaIrI_", "outputId": "18038ef5-554c-45c5-e00a-133b02ec10f1" @@ -476,7 +476,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": { "id": "6XN1Rq0aIrJC", "outputId": "a4405435-a8a9-41ff-9f79-a13077b587c7" @@ -882,7 +882,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 33, "metadata": { "id": "UmvbnJ9JIrJd" },