2020-04-03 13:05:00 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-03 14:19:40 +02:00
|
|
|
MYFILE="wikiniews_results.tsv"
|
2020-04-03 14:44:38 +02:00
|
|
|
COUNT=0
|
2020-04-03 14:46:01 +02:00
|
|
|
COUNT_DIFF=0
|
2020-04-03 14:44:38 +02:00
|
|
|
wc -l $myfile > $COUNT
|
2020-04-03 14:16:40 +02:00
|
|
|
|
|
|
|
# create trn
|
2020-04-03 14:19:40 +02:00
|
|
|
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
|
2020-04-03 14:16:40 +02:00
|
|
|
|
|
|
|
#wer for each line
|
2020-04-03 14:44:38 +02:00
|
|
|
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
|
|
|
|
|
2020-04-03 15:13:02 +02:00
|
|
|
RESULT = `expr $COUNT_DIFF / $COUNT * 100`
|
|
|
|
echo $RESULT > srr.text
|