Skip to content

Commit

Permalink
Fix: Made data parsing in the leaderboard figure more robust (#1450)
Browse files Browse the repository at this point in the history
Bugfixes with data parsing in main figure
  • Loading branch information
x-tabdeveloping authored Nov 14, 2024
1 parent 78c0e4e commit 4e86cea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mteb/leaderboard/figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def parse_n_params(text: str) -> int:


def parse_model_name(name: str) -> str:
if name is None:
return ""
if "]" not in name:
return name
name, _ = name.split("]")
return name[1:]

Expand All @@ -38,8 +42,8 @@ def performance_size_plot(df: pd.DataFrame) -> go.Figure:
df["Number of Parameters"] = df["Number of Parameters"].map(parse_n_params)
df["Model"] = df["Model"].map(parse_model_name)
df["model_text"] = df["Model"].where(df["Model"].isin(models_to_annotate), "")
df["Embedding Dimensions"] = df["Embedding Dimensions"].map(int)
df["Max Tokens"] = df["Max Tokens"].map(int)
df["Embedding Dimensions"] = df["Embedding Dimensions"].map(parse_float)
df["Max Tokens"] = df["Max Tokens"].map(parse_float)
df["Log(Tokens)"] = np.log10(df["Max Tokens"])
df["Mean (Task)"] = df["Mean (Task)"].map(parse_float)
df = df.dropna(subset=["Mean (Task)", "Number of Parameters"])
Expand Down

0 comments on commit 4e86cea

Please sign in to comment.