chan030609 commited on
Commit
2ac59aa
·
1 Parent(s): 0611e44
Files changed (2) hide show
  1. app.py +2 -6
  2. utils.py +5 -1
app.py CHANGED
@@ -45,17 +45,13 @@ with demo:
45
  )
46
 
47
  leaderboard_table = gr.components.Dataframe(
48
- value=load_data(CORPORA[0]).rename(columns={
49
- k: v for k, v in zip(DEFAULT_COLUMNS, DEFAULT_COLUMN_LABELS)
50
- }),
51
  interactive=True,
52
  visible=True,
53
  )
54
 
55
  corpus_dropdown.change(
56
- load_data.rename(columns={
57
- k: v for k, v in zip(DEFAULT_COLUMNS, DEFAULT_COLUMN_LABELS)
58
- }),
59
  inputs=[corpus_dropdown],
60
  outputs=leaderboard_table
61
  )
 
45
  )
46
 
47
  leaderboard_table = gr.components.Dataframe(
48
+ value=load_data(CORPORA[0]),
 
 
49
  interactive=True,
50
  visible=True,
51
  )
52
 
53
  corpus_dropdown.change(
54
+ load_data,
 
 
55
  inputs=[corpus_dropdown],
56
  outputs=leaderboard_table
57
  )
utils.py CHANGED
@@ -27,4 +27,8 @@ CORPORA = ['news', 'books']
27
  def load_data(corpus):
28
  assert corpus in CORPORA
29
  df = pd.read_csv(f"submission/{corpus}.csv")
30
- return df[DEFAULT_COLUMNS]
 
 
 
 
 
27
  def load_data(corpus):
28
  assert corpus in CORPORA
29
  df = pd.read_csv(f"submission/{corpus}.csv")
30
+ df = df[DEFAULT_COLUMNS].rename(columns={
31
+ k: v for k, v in zip(DEFAULT_COLUMNS, DEFAULT_COLUMN_LABELS)
32
+ })
33
+ return df
34
+