From 0bd59dfc21b8f256c532173dd4d63f70124abe1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriela=20Pa=C5=82ka?= Date: Fri, 3 Apr 2020 16:30:37 +0200 Subject: [PATCH] Change opening mode --- count_metrics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/count_metrics.py b/count_metrics.py index b386e63..7079ffe 100755 --- a/count_metrics.py +++ b/count_metrics.py @@ -6,8 +6,8 @@ if __name__ == '__main__': correct_sentences = 0 with open(sys.argv[1], 'r') as sclite_result, \ - open('wer.txt', 'w') as wer, \ - open('srr.txt', 'w') as srr: + open('wer.txt', 'a+') as wer, \ + open('srr.txt', 'a+') as srr: for line in sclite_result: complited = False @@ -18,9 +18,9 @@ if __name__ == '__main__': complited = True if complited: - wer.write(f'{word_error_rate:.5f}\n') + wer.write(f'{word_error_rate:.6f}\n') if word_error_rate == 0: correct_sentences += 1 sentence_recognition_rate = correct_sentences / number_of_sentence - srr.write(f'{sentence_recognition_rate:.5f}\n') + srr.write(f'{sentence_recognition_rate:.6f}\n')