lewtun HF staff commited on
Commit
85fb5e3
1 Parent(s): b727941

Add ranking and prettify column names

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -14,6 +14,8 @@ auth_token = os.getenv("HF_HUB_TOKEN")
14
  header = {"Authorization": "Bearer " + auth_token}
15
 
16
  TASKS = get_dataset_config_names("ought/raft")
 
 
17
 
18
 
19
  def extract_tags(dataset):
@@ -61,7 +63,8 @@ def format_submissions(submissions):
61
 
62
  df = pd.DataFrame(submission_data)
63
  df.insert(1, "Overall", df[TASKS].mean(axis=1))
64
-
 
65
  return df
66
 
67
 
 
14
  header = {"Authorization": "Bearer " + auth_token}
15
 
16
  TASKS = get_dataset_config_names("ought/raft")
17
+ # Split and capitalize the task names, e.g. banking_77 => Banking 77
18
+ FORMATTED_TASK_NAMES = [" ".join(t.capitalize() for t in task.split("_")) for task in TASKS]
19
 
20
 
21
  def extract_tags(dataset):
 
63
 
64
  df = pd.DataFrame(submission_data)
65
  df.insert(1, "Overall", df[TASKS].mean(axis=1))
66
+ df = df.copy().sort_values("Overall", ascending=False).reset_index().rename(columns={"index": "Rank"})
67
+ df.rename(columns={k: v for k, v in zip(TASKS, FORMATTED_TASK_NAMES)}, inplace=True)
68
  return df
69
 
70