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