metric stats accumulation

This commit is contained in:
Dawid Jurkiewicz 2020-04-03 14:00:11 +02:00
parent de9a4da7c2
commit d20910fb8a
3 changed files with 8 additions and 2 deletions

View File

@ -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

1
Jenkinsfile vendored
View File

@ -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') {

View File

@ -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