speechbrain.dataio.wer module

WER print functions.

The functions here are used to print the computed statistics with human-readable formatting. They have a file argument, but you can also just use contextlib.redirect_stdout, which may give a nicer syntax.

Authors
  • Aku Rouhe 2020

Summary

Functions:

print_alignments

Print WER summary and alignments.

print_wer_summary

Prints out WER summary details in human-readable format.

Reference

speechbrain.dataio.wer.print_wer_summary(wer_details, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Prints out WER summary details in human-readable format.

This function essentially mirrors the Kaldi compute-wer output format.

Parameters
  • wer_details (dict) – Dict of wer summary details, see speechbrain.utils.edit_distance.wer_summary for format.

  • file (stream) – Where to write. (default: sys.stdout)

speechbrain.dataio.wer.print_alignments(details_by_utterance, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, empty_symbol='<eps>', separator=' ; ', print_header=True, sample_separator=None)[source]

Print WER summary and alignments.

Parameters
  • details_by_utterance (list) – List of wer details by utterance, see speechbrain.utils.edit_distance.wer_details_by_utterance for format. Has to have alignments included.

  • file (stream) – Where to write. (default: sys.stdout)

  • empty_symbol (str) – Symbol to use when aligning to nothing.

  • separator (str) – String that separates each token in the output. Note the spaces in the default.

  • print_header (bool) – Whether to print headers

  • sample_separator (str) – A separator to put between samples (optional)