Skip to content

Commit

Permalink
WIP: Polishing up leaderboard UI (#1461)
Browse files Browse the repository at this point in the history
* fix: Removed column wrapping on the table, so that it remains readable

* Added disclaimer to figure

* fix: Added links to task info table, switched out license with metric
  • Loading branch information
x-tabdeveloping authored Nov 15, 2024
1 parent 68eb498 commit 58c459b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions mteb/leaderboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,25 @@ def format_list(props: list[str]):
return ", ".join(props)


def update_task_info(task_names: str) -> str:
def update_task_info(task_names: str) -> gr.DataFrame:
tasks = mteb.get_tasks(tasks=task_names)
df = tasks.to_dataframe()
df = tasks.to_dataframe(
properties=["name", "type", "languages", "domains", "reference", "main_score"]
)
df["languages"] = df["languages"].map(format_list)
df["domains"] = df["domains"].map(format_list)
df["name"] = "[" + df["name"] + "](" + df["reference"] + ")"
df = df.rename(
columns={
"name": "Task Name",
"type": "Task Type",
"languages": "Languages",
"domains": "Domains",
"license": "License",
"main_score": "Metric",
}
)
return df
df = df.drop(columns="reference")
return gr.DataFrame(df, datatype=["markdown"] + ["str"] * (len(df.columns) - 1))


all_results = load_results().filter_models()
Expand Down Expand Up @@ -215,6 +219,9 @@ def update_task_info(task_names: str) -> str:
citation = gr.Markdown(update_citation, inputs=[benchmark_select])
with gr.Column():
plot = gr.Plot(performance_size_plot, inputs=[summary_table])
gr.Markdown(
"*We only display models that have been run on all tasks in the benchmark*"
)
with gr.Tab("Summary"):
summary_table.render()
with gr.Tab("Performance per task"):
Expand Down
2 changes: 1 addition & 1 deletion mteb/leaderboard/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def scores_to_tables(
joint_table_style,
# column_widths=column_widths,
datatype=column_types,
wrap=True,
# wrap=True,
),
gr.DataFrame(per_task_style),
)

0 comments on commit 58c459b

Please sign in to comment.