victormiller commited on
Commit
f4bc6d2
1 Parent(s): a0d9a28

Update results.py

Browse files
Files changed (1) hide show
  1. results.py +19 -0
results.py CHANGED
@@ -1,7 +1,25 @@
1
  from fasthtml.common import *
2
  from fasthtml.components import *
 
 
 
3
 
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  intro_div = Div(
6
  H2("Perplexity Evaluation on Duplicate Data"),
7
  H3("Model based Quality Estimation"),
@@ -79,6 +97,7 @@ def results():
79
  intro_div,
80
  perp1_div,
81
  llama_div,
 
82
  id="inner-text"
83
  )
84
  )
 
1
  from fasthtml.common import *
2
  from fasthtml.components import *
3
+ import json
4
+ from matplotlib import pyplot
5
+ from fh_matplotlib import matplotlib2fasthtml
6
 
7
 
8
+ with open("graph_data.jsonl", 'r') as f:
9
+ for line in f:
10
+ for title, meta in json.loads(line).items():
11
+ _, ax = pyplot.subplots()
12
+ for i, (label, data, color) in enumerate(meta["data"]):
13
+ ax.plot(*data, label=label, color=color)
14
+
15
+ ax.grid()
16
+ ax.set_xlabel(meta["x_label"])
17
+ ax.set_ylabel(meta["y_label"])
18
+ ax.set_title(title)
19
+ ax.legend()
20
+
21
+ fig = pyplot.show()
22
+
23
  intro_div = Div(
24
  H2("Perplexity Evaluation on Duplicate Data"),
25
  H3("Model based Quality Estimation"),
 
97
  intro_div,
98
  perp1_div,
99
  llama_div,
100
+ matplotlib2fasthtml(fig),
101
  id="inner-text"
102
  )
103
  )