diff --git a/Jenkinsfile b/Jenkinsfile index 10ed82e..18d7a26 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,10 +11,10 @@ pipeline { stage('Run script and save results') { steps { sh('chmod +x ./shell_script.sh') - sh('./shell_script.sh wikiniews_results.tsv > result.log') + sh('./shell_script.sh wikiniews_results.tsv') archiveArtifacts 'result.log' - archiveArtifacts 'hypothesis.trn' - archiveArtifacts 'reference.trn' + archiveArtifacts 'wer.txt' + archiveArtifacts 'srr.txt' } } } diff --git a/shell_script.sh b/shell_script.sh index 19d82f5..c878b7d 100644 --- a/shell_script.sh +++ b/shell_script.sh @@ -1,6 +1,6 @@ #!/bin/bash -wc -l $1 +wc -l $1 > result.log cut -f 2 $1 > hypothesis.txt cut -f 3 $1 > reference.txt @@ -8,4 +8,8 @@ cut -f 3 $1 > reference.txt awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hypothesis.txt > hypothesis.trn 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 +sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores +awk 'BEGIN{FS=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"}{ if ( $1 == 0 ) good++; all++ }END{ print good/all }' wer.tsv > srr.txt