update Jenkinsfile, count, script

This commit is contained in:
dylodylo 2020-04-10 17:05:58 +02:00
parent 2ca0f5cedd
commit f363ed6fb2
3 changed files with 11 additions and 6 deletions

2
Jenkinsfile vendored
View File

@ -13,7 +13,7 @@ pipeline {
{
steps{
copyArtifacts filter: 'wikiniews_results.tsv', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful()
//copyArtifacts filter: 'srr.txt wer.txt', fingerprintArtifacts: true, projectName: 's460929-metrics', optional: true, selector: lastSuccessful()
copyArtifacts filter: 'srr.txt wer.txt', fingerprintArtifacts: true, projectName: 's460929-metrics', optional: true, selector: lastSuccessful()
}
}

View File

@ -8,11 +8,11 @@ cut -f2 $MYFILE | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > hypothesis.t
cut -f3 $MYFILE | awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' > reference.trn
#wer for each line
echo wer.txt | sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout >> wer.txt
echo wer.txt | sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all stdout >> scliteresult.txt
COUNT_DIFF=$(diff hypothesis.trn reference.trn | grep "^>" | wc -l)
echo $COUNT_DIFF
let RESULT=$COUNT_DIFF/$COUNT
echo $(echo "$COUNT_DIFF/$COUNT" | bc -l)
echo $(echo "$COUNT_DIFF/$COUNT" | bc -l) > srr.txt
echo $(echo "$COUNT_DIFF/$COUNT" | bc -l) >> srr.txt
echo "$(tail -50 "srr.txt")" > srr.txt

View File

@ -1,5 +1,5 @@
import csv
file = open("wer.txt", "r")
file = open("scliteresult.txt", "r")
scores = []
for f in file:
@ -9,7 +9,8 @@ for f in file:
scores.append(round(score,2))
file.close()
counter = len(scores)
scores_sum = 0
with open('wikiniews_results.tsv','r') as f_in:
with open('newresults.tsv', 'w') as f_out:
writer = csv.writer(f_out, delimiter=' ', lineterminator='\n')
@ -20,6 +21,10 @@ with open('wikiniews_results.tsv','r') as f_in:
for row,score in zip(reader, scores):
# add new column values
row.append('\t'+str(score))
scores_sum +=score
result.append(row)
writer.writerows(result)
writer.writerows(result)
file = open("wer.txt", "a")
file.write(str(score) + "\n")