poprawki do obliczania metryk 18

This commit is contained in:
alicja.m.musial 2020-04-03 17:09:39 +02:00
parent 8df9b8bbe4
commit 648728ef4a
2 changed files with 16 additions and 0 deletions

View File

@ -10,3 +10,4 @@ sclite -f 0 -r reference.trn trn -h hypothesis.trn trn -e utf-8 -i rm -o all std
python3 WERcreator.py
paste wikiniews_results.tsv wer.txt > new.txt && mv new.txt wikiniews_results.tsv
python3 werAvCounter.py

15
werAvCounter.py Normal file
View File

@ -0,0 +1,15 @@
import sys
if __name__ == '__main__':
sum = 0
lineCount = 0
werAv = 0
with open('wer.txt','a+') as werOut:
for line in werOut:
num = float(line)
sum += num
lineCount += 1
werAv = sum / lineCount
werOut.write(f'{werAv:.5f}\n')