Change table formatting
@@ -1448,20 +1448,18 @@ def response_table(predictions: Dict, context: str, answer: str, stats: Dict,
# Query response table columns
# [Column_name, key_name, format_string, rich_style] # description
- phrase_columns = sum([[['p', f'prob{i}', '{:.4f}', 'grey30'], # probability of top prediction
+ phrase_columns = sum([[['p', f'prob{i}', '{:.4f}', 'magenta'], # probability of top prediction
['pred', f'phrase{i}', '{}', ''], # phrase string prediction
] for i in range(number_of_predictions)], [])
columns = [column for column in neuron_stats_columns if column[1] in ['uid', 'loss_nxt', 'synergy_nxt']]
- print('phrase_columns', phrase_columns)
+
sort = sorted([(uid, s[sort_col]) for uid, s in stats.items() if sort_col in s],
reverse=True, key=lambda _row: _row[1])
rows = []
for uid, val in sort:
- print(uid, predictions[uid])
row = [txt.format(stats[uid][key]) for _, key, txt, _ in columns]
row += [txt.format(predictions[uid][key]) for _, key, txt, _ in phrase_columns]
- print(row)
rows += [row]
# === Response table ===
