Skip to content

Commit

Permalink
Update decode.py
Browse files Browse the repository at this point in the history
Resolve issues with abnormal output formats and inaccurate error rates
  • Loading branch information
fenghaojin authored Mar 14, 2024
1 parent f28c05f commit d5309db
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,15 @@ def save_results(
for key, results in results_dict.items():
recog_path = params.res_dir / f"recogs-{test_set_name}-{params.suffix}.txt"
results = sorted(results)
store_transcripts(filename=recog_path, texts=results)
store_transcripts(filename=recog_path, texts=results, char_level=True)
logging.info(f"The transcripts are stored in {recog_path}")

# The following prints out WERs, per-word error statistics and aligned
# ref/hyp pairs.
errs_filename = params.res_dir / f"errs-{test_set_name}-{params.suffix}.txt"
with open(errs_filename, "w") as f:
wer = write_error_stats(
f, f"{test_set_name}-{key}", results, enable_log=True
f, f"{test_set_name}-{key}", results, enable_log=True, compute_CER=True
)
test_set_wers[key] = wer

Expand Down

0 comments on commit d5309db

Please sign in to comment.