Commit
·
0ea49b5
1
Parent(s):
9ff73e7
update
Browse files
app.py
CHANGED
|
@@ -34,6 +34,16 @@ VISUALIZATION_DIRS = {
|
|
| 34 |
"Plan-of-SQLs": "htmls_POS_mod2"
|
| 35 |
}
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
METHODS = ["No-XAI", "Dater", "Chain-of-Table", "Plan-of-SQLs"]
|
| 38 |
|
| 39 |
def save_session_data(username, data):
|
|
@@ -232,7 +242,7 @@ def completed(username):
|
|
| 232 |
visualization_file = session_data['selected_samples'][sample_id]['file']
|
| 233 |
index = visualization_file.split('-')[1].split('.')[0]
|
| 234 |
|
| 235 |
-
ground_truth_key = f"{method
|
| 236 |
|
| 237 |
if ground_truth_key in ground_truth:
|
| 238 |
model_prediction = ground_truth[ground_truth_key]['answer'].upper()
|
|
|
|
| 34 |
"Plan-of-SQLs": "htmls_POS_mod2"
|
| 35 |
}
|
| 36 |
|
| 37 |
+
def get_method_dir(method):
|
| 38 |
+
if method == 'No-XAI':
|
| 39 |
+
return 'NO_XAI'
|
| 40 |
+
elif method == 'Dater':
|
| 41 |
+
return 'DATER'
|
| 42 |
+
elif method == 'Chain-of-Table':
|
| 43 |
+
return 'COT'
|
| 44 |
+
elif method == 'Plan-of-SQLs':
|
| 45 |
+
return 'POS'
|
| 46 |
+
|
| 47 |
METHODS = ["No-XAI", "Dater", "Chain-of-Table", "Plan-of-SQLs"]
|
| 48 |
|
| 49 |
def save_session_data(username, data):
|
|
|
|
| 242 |
visualization_file = session_data['selected_samples'][sample_id]['file']
|
| 243 |
index = visualization_file.split('-')[1].split('.')[0]
|
| 244 |
|
| 245 |
+
ground_truth_key = f"{get_method_dir(method)}_test-{index}.html"
|
| 246 |
|
| 247 |
if ground_truth_key in ground_truth:
|
| 248 |
model_prediction = ground_truth[ground_truth_key]['answer'].upper()
|