Update 2 Task 3
This commit is contained in:
parent
5ce3d39208
commit
b62473820d
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -11,10 +11,10 @@ pipeline {
|
|||||||
stage('Run script and save results') {
|
stage('Run script and save results') {
|
||||||
steps {
|
steps {
|
||||||
sh('chmod +x ./shell_script.sh')
|
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 'result.log'
|
||||||
archiveArtifacts 'hypothesis.trn'
|
archiveArtifacts 'wer.txt'
|
||||||
archiveArtifacts 'reference.trn'
|
archiveArtifacts 'srr.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
wc -l $1
|
wc -l $1 > result.log
|
||||||
|
|
||||||
cut -f 2 $1 > hypothesis.txt
|
cut -f 2 $1 > hypothesis.txt
|
||||||
cut -f 3 $1 > reference.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")"}' < hypothesis.txt > hypothesis.trn
|
||||||
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < reference.txt > reference.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
|
||||||
|
Loading…
Reference in New Issue
Block a user