From a39991b92db46127ad3a3ec87cd0a933b18c8013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pag=C3=A9s?= <55240756+clement-pages@users.noreply.github.com> Date: Fri, 18 Oct 2024 10:44:24 +0200 Subject: [PATCH] fix(community): replace `cpwer` by `min_cpwer` in cpwer breakdown --- tutorials/community/eval_separation_pipeline.ipynb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tutorials/community/eval_separation_pipeline.ipynb b/tutorials/community/eval_separation_pipeline.ipynb index 354fbfd99..1f5cf4e51 100644 --- a/tutorials/community/eval_separation_pipeline.ipynb +++ b/tutorials/community/eval_separation_pipeline.ipynb @@ -826,6 +826,7 @@ "from meeteval.wer.wer.cp import cp_word_error_rate\n", "\n", "min_error_rate = 1.0\n", + "min_cpwer = None\n", "\n", "all_permutations = list(permutations(predictions, len(references)))\n", "\n", @@ -834,7 +835,7 @@ " cpwer = cp_word_error_rate(references, list(permutation))\n", " if cpwer.error_rate < min_error_rate:\n", " min_error_rate = cpwer.error_rate\n", - " min_cpwer = cpwer\n" + " min_cpwer = cpwer" ] }, { @@ -861,10 +862,10 @@ } ], "source": [ - "C = cpwer.length - cpwer.errors\n", - "S = cpwer.substitutions\n", - "D = cpwer.deletions\n", - "I = cpwer.insertions\n", + "C = min_cpwer.length - min_cpwer.errors\n", + "S = min_cpwer.substitutions\n", + "D = min_cpwer.deletions\n", + "I = min_cpwer.insertions\n", "deletion_rate = D / (C + S + D) * 100\n", "insertion_rate = I / (C + S + D) * 100\n", "substitution_rate = S / (C + S + D) * 100\n", @@ -873,7 +874,7 @@ "print(f\"Substitution rate: {substitution_rate:.1f}%\")\n", "print(f\"Deletion rate: {deletion_rate:.1f}%\")\n", "print(f\"Insertion rate: {insertion_rate:.1f}%\")\n", - "print(f\"Total WER: {cpwer.error_rate * 100:.1f}%\")" + "print(f\"Total WER: {min_cpwer.error_rate * 100:.1f}%\")" ] }, {