Metrics
This commit is contained in:
parent
401cd58524
commit
c81375e356
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -20,6 +20,9 @@ pipeline {
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
archiveArtifacts 'cl_result.txt'
|
||||
archiveArtifacts 'wikiniews_results_wer.tsv'
|
||||
archiveArtifacts 'wer.txt'
|
||||
archiveArtifacts 'srr.txt'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
21
cl.sh
21
cl.sh
@ -1,3 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
wc -l wikiniews_results.tsv > cl_result.txt
|
||||
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
|
Loading…
Reference in New Issue
Block a user