Polish leaderboard table layout
Browse files
app.py
CHANGED
|
@@ -241,23 +241,22 @@ def filter_table(view: str, metric: str, family: str, query: str, top_n: int):
|
|
| 241 |
ascending = not HIGHER_IS_BETTER.get(metric, True)
|
| 242 |
ranked = df.sort_values(metric, ascending=ascending, na_position="last").head(int(top_n))
|
| 243 |
|
| 244 |
-
show_cols = [
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
]
|
| 261 |
remaining_metrics = [
|
| 262 |
col
|
| 263 |
for col in ranked.columns
|
|
@@ -394,7 +393,14 @@ with gr.Blocks(**BLOCKS_KWARGS) as demo:
|
|
| 394 |
|
| 395 |
note = gr.Markdown()
|
| 396 |
plot = gr.Plot()
|
| 397 |
-
table = gr.Dataframe(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
|
| 399 |
inputs = [view, metric, family, query, top_n]
|
| 400 |
for control in inputs:
|
|
|
|
| 241 |
ascending = not HIGHER_IS_BETTER.get(metric, True)
|
| 242 |
ranked = df.sort_values(metric, ascending=ascending, na_position="last").head(int(top_n))
|
| 243 |
|
| 244 |
+
show_cols = []
|
| 245 |
+
for col in [
|
| 246 |
+
"rank",
|
| 247 |
+
"display_name",
|
| 248 |
+
"method",
|
| 249 |
+
"family",
|
| 250 |
+
"dataset",
|
| 251 |
+
metric,
|
| 252 |
+
"mean_metric_rank",
|
| 253 |
+
"overall_mean_rank",
|
| 254 |
+
"coverage_success",
|
| 255 |
+
"row_count",
|
| 256 |
+
"setting_count",
|
| 257 |
+
]:
|
| 258 |
+
if col in ranked.columns and col not in show_cols:
|
| 259 |
+
show_cols.append(col)
|
|
|
|
| 260 |
remaining_metrics = [
|
| 261 |
col
|
| 262 |
for col in ranked.columns
|
|
|
|
| 393 |
|
| 394 |
note = gr.Markdown()
|
| 395 |
plot = gr.Plot()
|
| 396 |
+
table = gr.Dataframe(
|
| 397 |
+
label="Leaderboard table",
|
| 398 |
+
wrap=False,
|
| 399 |
+
interactive=False,
|
| 400 |
+
max_height=520,
|
| 401 |
+
column_widths=["72px", "230px", "220px", "150px", "140px", "150px"],
|
| 402 |
+
show_search="filter",
|
| 403 |
+
)
|
| 404 |
|
| 405 |
inputs = [view, metric, family, query, top_n]
|
| 406 |
for control in inputs:
|