Skip to content

Commit

Permalink
fix(community): replace cpwer by min_cpwer in cpwer breakdown
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-pages authored Oct 18, 2024
1 parent 1d36685 commit a39991b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tutorials/community/eval_separation_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
]
},
{
Expand All @@ -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",
Expand All @@ -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}%\")"
]
},
{
Expand Down

0 comments on commit a39991b

Please sign in to comment.