ftshijt commited on
Commit
18e7b60
1 Parent(s): d40804e

Update src/populate.py

Browse files
Files changed (1) hide show
  1. src/populate.py +8 -0
src/populate.py CHANGED
@@ -15,6 +15,14 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
15
  df = pd.DataFrame.from_records(all_data_json)
16
  # df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
17
  df = df.sort_values(by=[AutoEvalColumn.task5.name], ascending=True)
 
 
 
 
 
 
 
 
18
  df = df[cols].round(decimals=2)
19
 
20
  # filter out if any of the benchmarks have not been produced
 
15
  df = pd.DataFrame.from_records(all_data_json)
16
  # df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
17
  df = df.sort_values(by=[AutoEvalColumn.task5.name], ascending=True)
18
+
19
+ mos_rank = df[AutoEvalColumn.task2.name].rank(method="max", numeric_only=True, ascending=True)
20
+ bitrate_rank = df[AutoEvalColumn.task3.name].rank(method="min", numeric_only=True, ascending=True)
21
+ df["Ranking"] = pd.Series((mos_rank + bitrate_rank)/2)
22
+ df = df.sort_values(by=["Ranking", AutoEvalColumn.task2.name], ascending=True)
23
+ df["Rank"] = df.groupby("Precision").cumcount() + 1
24
+ df.pop("Ranking")
25
+
26
  df = df[cols].round(decimals=2)
27
 
28
  # filter out if any of the benchmarks have not been produced