Add sum for wer
This commit is contained in:
parent
4abece7b8c
commit
1566da1849
@ -6,8 +6,8 @@ if __name__ == '__main__':
|
||||
correct_sentences = 0
|
||||
|
||||
with open(sys.argv[1], 'r') as sclite_result, \
|
||||
open('wer.txt', 'a+') as wer, \
|
||||
open('srr.txt', 'a+') as srr:
|
||||
open('wer.txt', 'w') as wer, \
|
||||
open('srr.txt', 'w') as srr:
|
||||
|
||||
for line in sclite_result:
|
||||
complited = False
|
||||
|
@ -6,3 +6,5 @@ cut -f3 $1 | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > reference.trn
|
||||
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout > results.txt
|
||||
python3 count_metrics.py results.txt
|
||||
paste results.txt wer.txt > tmp.txt && mv tmp.txt results.txt
|
||||
cut -f5 results.txt
|
||||
awk '{ total += $1; count++ } END { print total/count }' wer.txt > average && mv average wer.txt
|
Loading…
Reference in New Issue
Block a user