diff --git a/script.py b/script.py index a2de7dc..9ab436e 100644 --- a/script.py +++ b/script.py @@ -1,22 +1,25 @@ import matplotlib from matplotlib import pyplot as plt import csv +import os probs = [] -with open('srr_results.txt','r') as srr_in: - with open('wer_results.txt', 'r') as wrr_in: - wrr_reader = csv.reader(wrr_in, lineterminator='\n') - srr_reader = csv.reader(srr_in, lineterminator='\n') - counter = 0 - wrr_scores = [] - srr_scores = [] - for wrr, srr in zip (wrr_reader, srr_reader): - wrr_scores.append(float(wrr[0])) - srr_scores.append(float(srr[0])) - counter+=1 +if os.path.exists('srr_results.txt') and os.path.exists('wer_results.txt'): + with open('srr_results.txt','r') as srr_in: + with open('wer_results.txt', 'r') as wrr_in: + wrr_reader = csv.reader(wrr_in, lineterminator='\n') + srr_reader = csv.reader(srr_in, lineterminator='\n') + + counter = 0 + wrr_scores = [] + srr_scores = [] + for wrr, srr in zip (wrr_reader, srr_reader): + wrr_scores.append(float(wrr[0])) + srr_scores.append(float(srr[0])) + counter+=1 for i in range(counter):