poprawki do obliczania metryk 18
This commit is contained in:
parent
8df9b8bbe4
commit
648728ef4a
@ -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
15
werAvCounter.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user