wer ard srr
This commit is contained in:
parent
18a2dacdae
commit
354f999b8b
20
script.sh
20
script.sh
@ -1,15 +1,13 @@
|
|||||||
wc -l wikiniews_results.tsv > res.txt
|
wc -l wikiniews_results.tsv > res.txt
|
||||||
|
|
||||||
awk -F "\t" '{print $3}' wikiniews_results.tsv > reference.txt
|
# create trn
|
||||||
awk -F "\t" '{print $2}' wikiniews_results.tsv > hypothesis.txt
|
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
|
||||||
|
|
||||||
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn
|
#wer for each line
|
||||||
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 | 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
|
||||||
|
|
||||||
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout
|
#average wer and srr
|
||||||
|
awk -F'\t' '{ total += $5; count++ } END { print total/count }' wikiniews_results_with_wer.tsv > wer.txt
|
||||||
echo 'hypo'
|
awk -F'\t' '{ if ( $5 == 0 ) good++; count++ } END { print good/count }' wikiniews_results_with_wer.tsv > srr.txt
|
||||||
cat hypothesis.trn
|
|
||||||
|
|
||||||
echo 'refe'
|
|
||||||
cat reference.trn
|
|
Loading…
Reference in New Issue
Block a user