abhinav-joshi commited on
Commit
510c4fb
·
verified ·
1 Parent(s): 5e11c1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +64 -21
app.py CHANGED
@@ -34,26 +34,51 @@ def baseline_load_data(tasks, task_metrics):
34
  with open("submissions/baseline/results.json") as f:
35
  results = json.load(f)
36
 
37
- # create a new df to display the results
38
- results_df = pd.DataFrame(
39
- columns=[
40
- "Method",
41
- "Submitted By",
42
- "Github Link",
43
- "L-NER",
44
- "RR",
45
- "CJPE",
46
- "BAIL",
47
- "LSI",
48
- "PCR",
49
- "SUMM",
50
- "L-MT",
51
- # "Average",
52
- ]
53
- )
54
- # breakpoint()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  for entry in results:
56
- results_df = results_df.append(
57
  {
58
  "Method": entry["Method"],
59
  "Submitted By": entry["Submitted By"],
@@ -67,10 +92,28 @@ def baseline_load_data(tasks, task_metrics):
67
  "SUMM": entry["SUMM"][task_metrics["SUMM"]],
68
  "L-MT": entry["L-MT"][task_metrics["L-MT"]],
69
  # "Average": ,
70
- },
71
- ignore_index=True,
72
  )
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  df = results_df
75
  # remove the columns that are not in tasks
76
  selected_columns = (
 
34
  with open("submissions/baseline/results.json") as f:
35
  results = json.load(f)
36
 
37
+ # # create a new df to display the results
38
+ # results_df = pd.DataFrame(
39
+ # columns=[
40
+ # "Method",
41
+ # "Submitted By",
42
+ # "Github Link",
43
+ # "L-NER",
44
+ # "RR",
45
+ # "CJPE",
46
+ # "BAIL",
47
+ # "LSI",
48
+ # "PCR",
49
+ # "SUMM",
50
+ # "L-MT",
51
+ # # "Average",
52
+ # ]
53
+ # )
54
+ # # breakpoint()
55
+ # for entry in results:
56
+ # results_df = results_df.append(
57
+ # {
58
+ # "Method": entry["Method"],
59
+ # "Submitted By": entry["Submitted By"],
60
+ # "Github Link": entry["Github Link"],
61
+ # "L-NER": entry["L-NER"][task_metrics["L-NER"]],
62
+ # "RR": entry["RR"][task_metrics["RR"]],
63
+ # "CJPE": entry["CJPE"][task_metrics["CJPE"]],
64
+ # "BAIL": entry["BAIL"][task_metrics["BAIL"]],
65
+ # "LSI": entry["LSI"][task_metrics["LSI"]],
66
+ # "PCR": entry["PCR"][task_metrics["PCR"]],
67
+ # "SUMM": entry["SUMM"][task_metrics["SUMM"]],
68
+ # "L-MT": entry["L-MT"][task_metrics["L-MT"]],
69
+ # # "Average": ,
70
+ # },
71
+ # ignore_index=True,
72
+ # )
73
+
74
+ # df = results_df
75
+
76
+ # Create an empty list to store row dictionaries
77
+ results_list = []
78
+
79
+ # Iterate and build the list of rows
80
  for entry in results:
81
+ results_list.append(
82
  {
83
  "Method": entry["Method"],
84
  "Submitted By": entry["Submitted By"],
 
92
  "SUMM": entry["SUMM"][task_metrics["SUMM"]],
93
  "L-MT": entry["L-MT"][task_metrics["L-MT"]],
94
  # "Average": ,
95
+ }
 
96
  )
97
 
98
+ # Create the final DataFrame directly from the list of rows
99
+ results_df = pd.DataFrame(
100
+ results_list,
101
+ columns=[
102
+ "Method",
103
+ "Submitted By",
104
+ "Github Link",
105
+ "L-NER",
106
+ "RR",
107
+ "CJPE",
108
+ "BAIL",
109
+ "LSI",
110
+ "PCR",
111
+ "SUMM",
112
+ "L-MT",
113
+ # "Average",
114
+ ]
115
+ )
116
+
117
  df = results_df
118
  # remove the columns that are not in tasks
119
  selected_columns = (