This commit is contained in:
s407323 2019-04-26 16:01:09 +02:00
parent 0dc5ead5b5
commit 1fb0be242b
4 changed files with 11 additions and 15 deletions

5
Jenkinsfile vendored
View File

@ -34,8 +34,9 @@ pipeline {
sh './zadanie3/trn.sh'
archiveArtifacts 'zadanie3/hypothesis.trn'
archiveArtifacts 'zadanie3/reference.trn'
archiveArtifacts 'zadanie3/results.txt'
archiveArtifacts 'zadanie3/results-p.txt'
sh 'chmod 755 ./zadanie3/grep.sh'
sh './zadanie3/grep.sh'
}
}
}

7
zadanie3/grep.sh Normal file
View File

@ -0,0 +1,7 @@
cat zadanie3/sclite.txt | grep -oP '(?<=Scores: \(#C #S #D #I\) ).*' > results_wer.txt
# (S + D + I)/(S + D + C)
awk '{ print ($2 + $3 + $4) / ($2 + $3 + $1) }' results_wer.txt
cat results_wer.txt

View File

@ -1,11 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy, pandas
input_data = pandas.read_csv('ASR-eval/wikiniews_results.tsv', encoding='latin1', error_bad_lines=False, sep='\t', header=None)
sentences = input_data[1]
references = input_data[2]
numpy.savetxt('zadanie3/sentences.txt', sentences, '%s')
numpy.savetxt('zadanie3/references.txt', references, '%s')

View File

@ -5,5 +5,4 @@ cut -f 3 ASR-eval/wikiniews_results.tsv > zadanie3/reference.txt
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < zadanie3/hypothesis.txt > zadanie3/hypothesis.trn
awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < zadanie3/reference.txt > zadanie3/reference.trn
sclite -f 0 -r zadanie3/reference.trn trn -h zadanie3/hypothesis.trn trn -e utf-8 -i rm -o all stdout > zadanie3/results.txt
sclite -f 0 -r zadanie3/reference.trn trn -h zadanie3/hypothesis.trn trn -e utf-8 -i rm -o all -p > zadanie3/results-p.txt
sclite -f 0 -r zadanie3/reference.trn trn -h zadanie3/hypothesis.trn trn -e utf-8 -i rm -o all stdout > zadanie3/sclite.txt