From edfda9ec1f13b1c5c5e6c35adfb6a7baf4d66cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriela=20Pa=C5=82ka?= Date: Fri, 3 Apr 2020 16:37:44 +0200 Subject: [PATCH] Latest version --- Jenkinsfile | 2 +- count_metrics.py | 4 ++-- script.sh | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 564cd85..b61266b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { } stage('ArchiveArtifacts') { steps { - archiveArtifacts 'results.txt, wer.txt, srr.txt' + archiveArtifacts 'wikiniews_results.tsv, wer.txt, srr.txt' } } stage('Build') { diff --git a/count_metrics.py b/count_metrics.py index a05fd4f..7079ffe 100755 --- a/count_metrics.py +++ b/count_metrics.py @@ -6,8 +6,8 @@ if __name__ == '__main__': correct_sentences = 0 with open(sys.argv[1], 'r') as sclite_result, \ - open('wer.txt', 'w') as wer, \ - open('srr.txt', 'w') as srr: + open('wer.txt', 'a+') as wer, \ + open('srr.txt', 'a+') as srr: for line in sclite_result: complited = False diff --git a/script.sh b/script.sh index 87814c1..885217f 100755 --- a/script.sh +++ b/script.sh @@ -5,6 +5,6 @@ cut -f3 $1 | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > reference.trn sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout > results.txt python3 count_metrics.py results.txt -paste results.txt wer.txt > tmp.txt && mv tmp.txt results.txt -cut -f5 results.txt -awk '{ total += $1; count++ } END { print total/count }' wer.txt > average && mv average wer.txt \ No newline at end of file +paste wikiniews_results.tsv wer.txt > tmp.txt && mv tmp.txt wikiniews_results.tsv +cp wer.txt average +awk '{ total += $1; count++ } END { print total/count }' wer.txt >> average && mv average wer.txt \ No newline at end of file