11#!/usr/bin/env python3
2- import sys
3- import collections
42import speechbrain .utils .edit_distance as edit_distance
53import speechbrain .data_io .wer as wer_io
64
@@ -47,6 +45,7 @@ def _utt2spk_keydict(path):
4745 utt2spk [utt ] = spk
4846 return utt2spk
4947
48+
5049if __name__ == "__main__" :
5150 import argparse
5251
@@ -58,8 +57,10 @@ def _split_lines(self, text, width):
5857 return argparse .HelpFormatter ._split_lines (self , text , width )
5958
6059 parser = argparse .ArgumentParser (
61- description = ("Compute word error rate or a Levenshtein alignment"
62- "between a hypothesis and a reference." ),
60+ description = (
61+ "Compute word error rate or a Levenshtein alignment"
62+ "between a hypothesis and a reference."
63+ ),
6364 formatter_class = SmartFormatter ,
6465 )
6566 parser .add_argument (
@@ -89,14 +90,18 @@ def _split_lines(self, text, width):
8990 parser .add_argument (
9091 "--print-alignments" ,
9192 action = "store_true" ,
92- help = ("Print alignments for between all refs and hyps."
93- "Also has details for individual hyps. Outputs a lot of text." ),
93+ help = (
94+ "Print alignments for between all refs and hyps."
95+ "Also has details for individual hyps. Outputs a lot of text."
96+ ),
9497 )
9598 parser .add_argument (
9699 "--align-separator" ,
97100 default = " ; " ,
98- help = ("When printing alignments, separate tokens with this."
99- "Note the spaces in the default." ),
101+ help = (
102+ "When printing alignments, separate tokens with this."
103+ "Note the spaces in the default."
104+ ),
100105 )
101106 parser .add_argument (
102107 "--align_empty" ,
0 commit comments