wer ard srr
This commit is contained in:
parent
81ccda3c4d
commit
f8e48378db
28
Jenkinsfile
vendored
28
Jenkinsfile
vendored
@ -19,11 +19,30 @@ pipeline {
|
|||||||
sh 'chmod +x script.sh'
|
sh 'chmod +x script.sh'
|
||||||
sh './script.sh'
|
sh './script.sh'
|
||||||
sh label: 'cat', script: 'cat res.txt'
|
sh label: 'cat', script: 'cat res.txt'
|
||||||
echo 'WER and SRR metrics'
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Dockerfile') {
|
||||||
|
steps {
|
||||||
|
sh 'gcc --version'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Counting metricts') {
|
||||||
|
steps {
|
||||||
|
sh 'chmod +x metricts.sh'
|
||||||
|
sh './metricts.sh'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Accumulate metrics results'){
|
||||||
|
steps{
|
||||||
|
copyArtifacts filter: 'srr.txt, wer.txt', fingerprintArtifacts: true, optional: true, projectName: 's152203-mlworkshops', target: 'last-results'
|
||||||
|
sh label: '', script: './to_file.sh last-results/srr.txt srr.txt'
|
||||||
|
sh label: '', script: './to_file.sh last-results/wer.txt wer.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('archiveArtifacts'){
|
stage('archiveArtifacts'){
|
||||||
steps{
|
steps{
|
||||||
archiveArtifacts 'res.txt'
|
archiveArtifacts 'res.txt'
|
||||||
@ -33,10 +52,5 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Dockerfile') {
|
|
||||||
steps {
|
|
||||||
sh 'gcc --version'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
14
script.sh
14
script.sh
@ -1,13 +1,3 @@
|
|||||||
wc -l wikiniews_results.tsv > res.txt
|
#!/bin/bash
|
||||||
|
|
||||||
# create trn
|
wc -l wikiniews_results.tsv > res.txt
|
||||||
cut -f2 $1 | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > hypothesis.trn
|
|
||||||
cut -f3 $1 | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > reference.trn
|
|
||||||
|
|
||||||
#wer for each line
|
|
||||||
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores | awk -v OFS='\t' '{print $6, $7, $8, $9}' | awk '{print ($2 + $3 + $4)/($2 + $3 + $1) }' > wer_per_line.tsv
|
|
||||||
paste $1 wer_per_line.tsv > wikiniews_results_with_wer.tsv
|
|
||||||
|
|
||||||
#average wer and srr
|
|
||||||
awk -F'\t' '{ total += $5; count++ } END { print total/count }' wikiniews_results_with_wer.tsv > wer.txt
|
|
||||||
awk -F'\t' '{ if ( $5 == 0 ) good++; count++ } END { print good/count }' wikiniews_results_with_wer.tsv > srr.txt
|
|
Loading…
Reference in New Issue
Block a user