Skip to content

Commit

Permalink
Fix wer.py where 'errors' variable was not set (NVIDIA#6633) (NVIDIA#…
Browse files Browse the repository at this point in the history
…6634)

Fix wer.py where 'errors' variable was not set when both reference and hypothesis are empty strings

Signed-off-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com>
Co-authored-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com>
Signed-off-by: hsiehjackson <c2hsieh@ucsd.edu>
  • Loading branch information
2 people authored and hsiehjackson committed Jun 2, 2023
1 parent c44e3b6 commit ef49b0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nemo/collections/asr/metrics/wer.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def word_error_rate_detail(
if len(h_list) != 0:
errors = len(h_list)
ops_count['insertions'] += errors
else:
errors = 0
else:
if use_cer:
measures = jiwer.cer(r, h, return_dict=True)
Expand Down

0 comments on commit ef49b0a

Please sign in to comment.