Update script

This commit is contained in:
s416178 2020-04-03 13:49:43 +02:00
parent f586f473a5
commit df08496ffa
2 changed files with 6 additions and 2 deletions

1
Jenkinsfile vendored
View File

@ -6,6 +6,7 @@ pipeline {
steps { steps {
git 'https://git.wmi.amu.edu.pl/s416178/s416178-mlworkshops' git 'https://git.wmi.amu.edu.pl/s416178/s416178-mlworkshops'
copyArtifacts filter: 'wikiniews_results.tsv', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful(), target: './' copyArtifacts filter: 'wikiniews_results.tsv', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful(), target: './'
copyArtifacts filter: 'srr.txt, wer.txt', fingerprintArtifacts: true, optional: true, projectName: 's416178-metrics', target: './'
} }
} }
stage('Run script and save results') { stage('Run script and save results') {

View File

@ -11,5 +11,8 @@ awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.trn
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores
awk 'BEGIN{OFS="\t"}{print $6, $7, $8, $9}' < scores | awk '{ print ($2 + $3 + $4)/($2 + $3 + $1) }' > wer.tsv awk 'BEGIN{OFS="\t"}{print $6, $7, $8, $9}' < scores | awk '{ print ($2 + $3 + $4)/($2 + $3 + $1) }' > wer.tsv
awk 'BEGIN{FS=OFS="\t"}{ bad = bad + $1; all++ }END{ print bad/all }' < wer.tsv > wer.txt 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 awk 'BEGIN{FS=OFS="\t"}{ if ( $1 == 0 ) good++; all++ }END{ print good/all }' < wer.tsv >> srr.txt
tail -500 wer.txt > wer.txt
tail -500 srr.txt > srr.txt