diff --git a/metricts.sh b/metricts.sh new file mode 100644 index 0000000..b156885 --- /dev/null +++ b/metricts.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +cut -f2 $1 | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > hypothesis.trn +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 | grep Scores | awk -v OFS='\t' '{print $6, $7, $8, $9}' | awk '{print ($2 + $3 + $4)/($2 + $3 + $1) }' > wer_per_line.tsv +paste $1 wer_per_line.tsv > wikiniews_results_with_wer.tsv + +awk -F'\t' '{ total += $5; count++ } END { print total/count }' wikiniews_results_with_wer.tsv > wer.txt +awk -F'\t' '{ if ( $5 == 0 ) good++; count++ } END { print good/count }' wikiniews_results_with_wer.tsv > srr.txt \ No newline at end of file diff --git a/to_file.sh b/to_file.sh new file mode 100644 index 0000000..fab3c6d --- /dev/null +++ b/to_file.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +mv $1 $1.last +tail -999 $1.last > $1.last_1000 +cat $2 >> $1.last_1000 +mv $1.last_1000 $2 \ No newline at end of file