22 lines
527 B
Python
22 lines
527 B
Python
|
#!/usr/bin/env python3
|
||
|
import matplotlib.pyplot as plt
|
||
|
|
||
|
|
||
|
def read_into_file(file_name: str) -> list:
|
||
|
with open(file_name, 'r') as f:
|
||
|
return f.read().splitlines()
|
||
|
|
||
|
|
||
|
def generate_plot(data: list, label: str, file_name: str):
|
||
|
plt.plot(data)
|
||
|
plt.ylabel(label)
|
||
|
plt.savefig(file_name)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
wer = [float(i) for i in read_into_file('wer.txt')]
|
||
|
srr = [float(i) for i in read_into_file('srr.txt')]
|
||
|
|
||
|
generate_plot(wer, 'WER', 'wer.png')
|
||
|
generate_plot(srr, 'SRR', 'srr.png')
|