From 94b9fcb6a0d1ad29e0145a593b4a13199979855a Mon Sep 17 00:00:00 2001 From: Marek Wendlandt Date: Thu, 16 May 2019 17:00:29 +0000 Subject: [PATCH] metryki --- metryki.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 metryki.sh diff --git a/metryki.sh b/metryki.sh new file mode 100644 index 0000000..d452ef2 --- /dev/null +++ b/metryki.sh @@ -0,0 +1,15 @@ +cut -f 2 wikiniews_results.tsv > reference.txt +cut -f 3 wikiniews_results.tsv > hypothesis.txt + +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn +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 > sclite.txt +grep 'Scores:' wynik.txt | awk '{print $6, $7, $8, $9}' > scores.txt + +awk '{ print ($2 + $3 + $4) / ($2 + $3 + $1) }' scores.txt > WER.txt +awk '{ n++; if ($2 == 0 && $3 == 0 && $4 == 0) poprawne += 1 } END { print poprawne/n }' scores.txt > SSR.txt +awk '{ n++; suma += $1 } END { print suma/n }' WER.txt > sredniaWER.txt + + +paste wikiniews_results.tsv WER.txt > wikiniews_results_WER.tsv \ No newline at end of file