From d20910fb8a63bbda30d4214d79884f5b697d8fe1 Mon Sep 17 00:00:00 2001 From: Dawid Jurkiewicz Date: Fri, 3 Apr 2020 14:00:11 +0200 Subject: [PATCH] metric stats accumulation --- Dockerfile | 1 + Jenkinsfile | 1 + calc_metrics.sh | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 758ce2d..7850706 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN apt install -y git RUN apt install -y gcc RUN gcc --version RUN apt install -y build-essential +RUN apt install -y moreutils RUN python --version RUN git clone https://github.com/usnistgov/SCTK.git WORKDIR SCTK diff --git a/Jenkinsfile b/Jenkinsfile index ecb4ff7..0a3471b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,7 @@ pipeline { steps { checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '8dbda16d-2863-4ee8-8662-3886a4862575', url: 'https://git.wmi.amu.edu.pl/dawjur/dawjur-mlworkshops']]]) copyArtifacts filter: 'wikiniews_results.tsv', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful() + copyArtifacts excludes: 'wikinews_results.tsv', fingerprintArtifacts: true, projectName: 'dawjur-metrics', selector: lastSuccessful() } } stage('Count lines') { diff --git a/calc_metrics.sh b/calc_metrics.sh index 6c3aa6b..c951269 100755 --- a/calc_metrics.sh +++ b/calc_metrics.sh @@ -3,9 +3,13 @@ cut -f2 wikiniews_results.tsv | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' cut -f3 wikiniews_results.tsv | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > ref.trn sclite -f 0 -r ref.trn trn -h hyp.trn trn -e utf-8 -i rm -o sum stdout | grep "Sum/Avg" | python -c "import sys; import re; print('\t'.join(re.findall(r'(\d+\.\d+)', sys.stdin.read())[-2:]))" > wer_srr.txt cut -f1 wer_srr.txt > wer_total.txt -cut -f2 wer_srr.txt > srr.txt +cut -f2 wer_srr.txt >> srr.txt sclite -f 0 -r ref.trn trn -h hyp.trn trn -e utf-8 -i rm -o pra stdout | grep "Scores:" | sed 's/Scores: (#C #S #D #I) // ' | awk '{ c=$1; s=$2; d=$3; i=$4; print ($s+$d+$i)/($s+$d+$c)}' > wer_all.txt -awk '{ sum += $1; n++ } END { print sum / n; }' < wer_all.txt > wer.txt +awk '{ sum += $1; n++ } END { print sum / n; }' < wer_all.txt >> wer.txt + paste wikiniews_results.tsv wer.txt > wikinews_results.tsv rm wikiniews_results.tsv + +tail -n20 wer.txt | sponge wer.txt +tail -n20 srr.txt | sponge srr.txt