This commit is contained in:
s152483 2020-04-22 22:37:07 +02:00
parent c81375e356
commit 369dc845b8

6
cl.sh
View File

@ -14,9 +14,9 @@ awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.trn
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores
# WER
awk 'BEGIN{OFS="\t"}' < scores | awk '{print ($2+$3+$4)/($2+$3+$1)}' > wer.tsv
awk 'BEGIN{OFS="\t"}{print $6, $7, $8, $9}' < scores | awk '{print ($2+$3+$4)/($2+$3+$1)}' > wer.tsv
paste wikiniews_results.tsv wer.tsv > wikiniews_results_wer.tsv
awk '{notCorrect+=$1; sum++} END {print notCorrect/sum}' < wer.tsv >> wer.txt
awk 'BEGIN{FS=OFS="\t"}{notCorrect+=$1; sum++} END {print notCorrect/sum}' < wer.tsv >> wer.txt
# SRR
awk '{if($1==0) correct++; total++} END {print correct/total}' < wer.tsv >> srr.txt
awk 'BEGIN{FS=OFS="\t"}{if($1==0) correct++; total++} END {print correct/total}' < wer.tsv >> srr.txt