Task 3 - calculate wer per line
This commit is contained in:
parent
900b08d8c8
commit
7f9878ec18
@ -12,5 +12,8 @@ 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'
|
# 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
|
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 'BEGIN{OFS="\t"}{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
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user