17 lines
493 B
Bash
17 lines
493 B
Bash
#!/bin/bash
|
|
|
|
MYFILE="wikiniews_results.tsv"
|
|
COUNT=0
|
|
COUNT_DIFF=0
|
|
wc -l $myfile > $COUNT
|
|
|
|
# create trn
|
|
cut -f2 $MYFILE | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > hypothesis.trn
|
|
cut -f3 $MYFILE | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > reference.trn
|
|
|
|
#wer for each line
|
|
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout > wer.txt
|
|
diff hypothesis.trn reference.trn | grep "^>" | wc -l > $COUNT_DIFF
|
|
|
|
$COUNT = $COUNT_DIFF/$COUNT*100 > srr.text
|