daishen commited on
Commit
def1d66
·
1 Parent(s): 55d67f1

update leaderboard

Browse files
Files changed (3) hide show
  1. get_data_info.py +14 -12
  2. leaderboard.xlsx +0 -0
  3. scores.xlsx +0 -0
get_data_info.py CHANGED
@@ -7,7 +7,8 @@ def process_plot_data(df, flag=False):
7
  # 保留"Model"和"Domain"列,删除其他列
8
  df2 = df[["Model", "Domain"]].copy()
9
 
10
- columns_names = ["Model", "Domain", "AR", "ER", "NER", "JS", "CR", "CFM", "SCM", "CJP", "CTP", "LQA", "JRG", "CU", "LC"]
 
11
  # 计算新的列的值
12
  for col in columns_names[2:]:
13
  if col in ["AR", "ER", "CR", "CFM", "SCM", "CTP", "LQA"]:
@@ -16,14 +17,15 @@ def process_plot_data(df, flag=False):
16
  df2[col] = df[[f"{col}-CP-F1", f"{col}-PTP-F1"]].mean(axis=1) * 100
17
  if col == "NER":
18
  df2[col] = df[f"{col}-Acc"] * 100
19
- if col in ["JRG", "LC"]:
20
  rouge_mean = df[[f"{col}-ROUGE-1", f"{col}-ROUGE-2", f"{col}-ROUGE-L"]].replace('-', np.nan).mean(axis=1)
21
  df2.loc[df[f"{col}-ROUGE-1"] == '-', col] = '-'
22
  df2.loc[df[f"{col}-ROUGE-1"] != '-', col] = rouge_mean * 100
23
- if col in ["JS", "CU"]:
24
- df2[col] = df[[f"{col}-ROUGE-1", f"{col}-ROUGE-2", f"{col}-ROUGE-L"]].mean(axis=1) * 100
25
  df2.reindex(columns=columns_names)
26
 
 
27
  if flag:
28
  # 保存到Excel文件
29
  with pd.ExcelWriter('scores.xlsx') as writer:
@@ -37,8 +39,8 @@ def plot_data():
37
  'leaderboard.xlsx',
38
  sheet_name='Sheet2',
39
  header=0,
40
- usecols='A:AS',
41
- nrows=14)
42
  leaderboard_df.fillna("-")
43
 
44
  df = process_plot_data(leaderboard_df)
@@ -64,16 +66,16 @@ def tab_data():
64
  'leaderboard.xlsx',
65
  sheet_name='Sheet2',
66
  header=0,
67
- usecols='A:AS',
68
- nrows=14)
69
  leaderboard_df.fillna("-")
70
 
71
- df_nlp = leaderboard_df.iloc[:, [0] + list(range(2, 9)) + list(range(12, 18))] # todo
72
- df_basic = leaderboard_df.iloc[:, [0] + list(range(18, 36))] # todo
73
- df_complex = leaderboard_df.iloc[:, [0] + list(range(36, 45))] # todo
74
 
75
  # Get df_overall
76
- df_overall = leaderboard_df.iloc[:, [0] + list(range(2, 45))]
77
  plot_df_dict = {
78
  "Overall": df_overall,
79
  "Basic Legal NLP": df_nlp,
 
7
  # 保留"Model"和"Domain"列,删除其他列
8
  df2 = df[["Model", "Domain"]].copy()
9
 
10
+ columns_names = ["Model", "Domain", "AR", "ER", "NER", "JS", "CR", "CFM", "SCM",
11
+ "CJP", "CTP", "LQA", "JRG", "CU", "LC", "JRG-TAG", "LC-TAG"]
12
  # 计算新的列的值
13
  for col in columns_names[2:]:
14
  if col in ["AR", "ER", "CR", "CFM", "SCM", "CTP", "LQA"]:
 
17
  df2[col] = df[[f"{col}-CP-F1", f"{col}-PTP-F1"]].mean(axis=1) * 100
18
  if col == "NER":
19
  df2[col] = df[f"{col}-Acc"] * 100
20
+ if col in ["JRG", "LC", "JS", "CU", "JRG-TAG", "LC-TAG"]:
21
  rouge_mean = df[[f"{col}-ROUGE-1", f"{col}-ROUGE-2", f"{col}-ROUGE-L"]].replace('-', np.nan).mean(axis=1)
22
  df2.loc[df[f"{col}-ROUGE-1"] == '-', col] = '-'
23
  df2.loc[df[f"{col}-ROUGE-1"] != '-', col] = rouge_mean * 100
24
+ # if col in ["JS", "CU"]:
25
+ # df2[col] = df[[f"{col}-ROUGE-1", f"{col}-ROUGE-2", f"{col}-ROUGE-L"]].mean(axis=1) * 100
26
  df2.reindex(columns=columns_names)
27
 
28
+ flag = True
29
  if flag:
30
  # 保存到Excel文件
31
  with pd.ExcelWriter('scores.xlsx') as writer:
 
39
  'leaderboard.xlsx',
40
  sheet_name='Sheet2',
41
  header=0,
42
+ usecols='A:BE',
43
+ nrows=18)
44
  leaderboard_df.fillna("-")
45
 
46
  df = process_plot_data(leaderboard_df)
 
66
  'leaderboard.xlsx',
67
  sheet_name='Sheet2',
68
  header=0,
69
+ usecols='A:BE',
70
+ nrows=18)
71
  leaderboard_df.fillna("-")
72
 
73
+ df_nlp = leaderboard_df.iloc[:, list(range(0, 18))] # todo
74
+ df_basic = leaderboard_df.iloc[:, list(range(0, 2)) + list(range(18, 42))] # todo
75
+ df_complex = leaderboard_df.iloc[:, list(range(0, 2)) + list(range(42, 56))] # todo
76
 
77
  # Get df_overall
78
+ df_overall = leaderboard_df.iloc[:, list(range(0, 56))]
79
  plot_df_dict = {
80
  "Overall": df_overall,
81
  "Basic Legal NLP": df_nlp,
leaderboard.xlsx CHANGED
Binary files a/leaderboard.xlsx and b/leaderboard.xlsx differ
 
scores.xlsx CHANGED
Binary files a/scores.xlsx and b/scores.xlsx differ