From 2c6424ef3d7b7a17fa54b41de5cec1d3962d8294 Mon Sep 17 00:00:00 2001 From: Diana-Krol Date: Mon, 6 Apr 2020 21:57:55 +0200 Subject: [PATCH] metryki --- jenkinsfile | 3 +++ lines.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/jenkinsfile b/jenkinsfile index 9144de4..02713c0 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -10,6 +10,9 @@ pipeline { sh(' ./lines.sh') archiveArtifacts 'lines_number.txt' archiveArtifacts 'wer.txt' + archiveArtifacts 'srr.txt' + archiveArtifacts 'wer.tsv' + archiveArtifacts 'wikiniews_results_with_wer.tsv' } } } diff --git a/lines.sh b/lines.sh index d6540ef..fcaf37c 100644 --- a/lines.sh +++ b/lines.sh @@ -1,3 +1,32 @@ # zliczenie liczby linijekw pliku wikinews i zapisanie do lines_number.txt wc -l wikiniews_results.tsv > lines_number.txt +#utworzenie plików hypothesis i reference +#wycięcie drugiej kolumny (hipotez - wyniki rozpoznawania ASR) +cut -f2 wikiniews_results.tsv > hypothesis.txt +#wycięcie trzeciej kolumnu (referencje - poprawne zdania) +cut -f3 wikiniews_results.tsv > reference.txt + +#przekształcenie plików txt na trn +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.trn +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn + +#przenieś i zapisz 50 obserwacji +mv wer.txt wer1.txt +mv srr.txt srr1.txt + +#wyświetlanie i zapisywanie +cat wer1.txt | tail -n 49 > wer.txt +cat srr1.txt | tail -n 49 > srr.txt + +#wywołanie sclite +sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores + +#hyphothesis - wyniki działania ARS +#reference - referencyjne zdania + +awk 'BEGIN{OFS="\t"}{print $6, $7, $8, $9}' < scores | awk '{ print ($2 + $3 + $4)/($2 + $3 + $1) }' > wer.tsv +paste wikiniews_results.tsv wer.tsv > wikiniews_results_with_wer.tsv + +awk 'BEGIN{FS=OFS="\t"}{ bad = bad + $1; all++ }END{ print bad/all }' < wer.tsv >> wer.txt +awk 'BEGIN{FS=OFS="\t"}{ if ( $1 == 0 ) good++; all++ }END{ print good/all }' < wer.tsv >> srr.txt \ No newline at end of file