From 449da50f92a391809272493f9b43aec367a20496 Mon Sep 17 00:00:00 2001 From: s452111 Date: Wed, 22 Apr 2020 13:44:10 +0200 Subject: [PATCH] Task 3 - calculate wer per line --- metrics_service.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/metrics_service.sh b/metrics_service.sh index 8c5f448..3f917d0 100644 --- a/metrics_service.sh +++ b/metrics_service.sh @@ -12,8 +12,11 @@ awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.tr # use sclite to calculate WER, actually we need only lines starting with 'Scores' sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep "Scores:" > wer_results.txt -cat wer_results.txt | awk '{print ( ($7 + $8 + $9) / ($7 + $8 + &6) ) * 100;}' >> wer_per_line.txt +cat wer_results.txt | awk '{print ( ($7 + $8 + $9) / ($7 + $8 + $6) ) * 100;}' >> wer_per_line.txt paste wer_per_line.txt wikiniews_results.tsv # calculate mean WER for all records -awk '{sum += &1; n++} END { print sum / n; }' < wer_per_lines.txt > wer.txt +awk '{sum += $1; n++} END { print sum / n; }' < wer_per_lines.txt > wer.txt + +# calculate SSR +