This commit is contained in:
s152483 2020-04-22 22:31:46 +02:00
parent 401cd58524
commit c81375e356
2 changed files with 23 additions and 1 deletions

3
Jenkinsfile vendored
View File

@ -20,6 +20,9 @@ pipeline {
stage('Archive Artifacts') {
steps {
archiveArtifacts 'cl_result.txt'
archiveArtifacts 'wikiniews_results_wer.tsv'
archiveArtifacts 'wer.txt'
archiveArtifacts 'srr.txt'
}
}
}

19
cl.sh
View File

@ -1,3 +1,22 @@
#!/bin/sh
wc -l wikiniews_results.tsv > cl_result.txt
# Otrzymanie plików reference.txt i hypothesis.txt
cut -f 2 wikiniews_results.tsv > hypothesis.txt
cut -f 3 wikiniews_results.tsv > reference.txt
# Zmiana formatu z txt na 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
# Wywołanie SCLITE
sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout | grep Scores > scores
# WER
awk 'BEGIN{OFS="\t"}' < scores | awk '{print ($2+$3+$4)/($2+$3+$1)}' > wer.tsv
paste wikiniews_results.tsv wer.tsv > wikiniews_results_wer.tsv
awk '{notCorrect+=$1; sum++} END {print notCorrect/sum}' < wer.tsv >> wer.txt
# SRR
awk '{if($1==0) correct++; total++} END {print correct/total}' < wer.tsv >> srr.txt