jenkinsfile

This commit is contained in:
unknown 2020-04-03 15:33:21 +02:00
parent 1a63b463f5
commit dc7a4aa903
2 changed files with 28 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import re
import csv
wer = open("wer.txt","w")
ssr = open("ssr.txt","w")
@ -10,6 +11,10 @@ counter = 0
ssrCounter = 0
inputLines = ""
werArray = []
with open("helper.txt", "r") as f:
for line in f:
if re.match(r'^id:.*', line):
@ -22,9 +27,31 @@ with open("helper.txt", "r") as f:
ssrCounter += 1
globalPercent += sum
counter += 1
werArray.append(sum)
wer.write(lastId + " = " + str(sum) + "%\n")
wer.write("AVG: " + str(float((globalPercent) / (float(counter) * 100)*100)) + "%")
ssr.write(str(float(ssrCounter)/float(counter) * 100) + "%")
wer.close()
ssr.close()
ssr.close()
with open('wikiniews_results.tsv','r') as f_in:
with open('wikiniews_results2.tsv', 'w') as f_out:
writer = csv.writer(f_out, delimiter=' ', lineterminator='\n')
reader = csv.reader(f_in, delimiter=' ')
result = []
# read headers
row = next(reader)
# add new header to list of headers
row.append('Col5')
result.append(row)
counter = 0
for row in reader:
# add new column values
row.append(werArray[counter])
counter += 1
result.append(row)
writer.writerows(result)

View File

@ -10,7 +10,6 @@ sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all std
python ./createWERandSRRFiles.py
head -5 ssr.txt
head -250 wer.txt