David Dale commited on
Commit
e5fc052
·
1 Parent(s): 2363c06

super basic leaderboard

Browse files
Files changed (3) hide show
  1. app.py +15 -3
  2. data/benchmark_stats.tsv +0 -0
  3. requirements.txt +2 -0
app.py CHANGED
@@ -7,9 +7,12 @@
7
  import gradio as gr
8
  from huggingface_hub import whoami
9
  from huggingface_hub.errors import LocalTokenNotFoundError
 
10
  import argilla as rg
11
  import os
12
  from requests.exceptions import HTTPError
 
 
13
 
14
  CLA = """
15
  Meta Platforms, Inc. Individual Contributor License Agreement ("Agreement"), v2.0
@@ -399,9 +402,19 @@ If you want to contribute dataset translations for a new language or validate ex
399
 
400
 
401
  def leaderboard_tab():
 
 
 
 
402
  with gr.Tab("Leaderboard"):
403
- gr.Markdown("Coming soon!")
404
-
 
 
 
 
 
 
405
 
406
  with gr.Blocks(
407
  css="""
@@ -426,4 +439,3 @@ with gr.Blocks(
426
 
427
  if __name__ == "__main__":
428
  demo.launch()
429
-
 
7
  import gradio as gr
8
  from huggingface_hub import whoami
9
  from huggingface_hub.errors import LocalTokenNotFoundError
10
+ from gradio_leaderboard import Leaderboard
11
  import argilla as rg
12
  import os
13
  from requests.exceptions import HTTPError
14
+ import csv
15
+ import pandas as pd
16
 
17
  CLA = """
18
  Meta Platforms, Inc. Individual Contributor License Agreement ("Agreement"), v2.0
 
402
 
403
 
404
  def leaderboard_tab():
405
+ stats = pd.read_csv("data/benchmark_stats.tsv", sep="\t", quoting=csv.QUOTE_NONE)
406
+ df = stats.groupby(['system', 'level'])[
407
+ ['score_metricx_both', 'score_xcomet_both', 'score_CHRFpp', 'score_glotlid_ref']
408
+ ].mean().reset_index().sort_values('score_metricx_both')
409
  with gr.Tab("Leaderboard"):
410
+ gr.Markdown("The current leaderboard displays performance across all directions in the benchmark.")
411
+ gr.Markdown("A smarter leaderboard and the code for reproducing the evaluation will be published soon!")
412
+ # Leaderboard(
413
+ # value=df,
414
+ # select_columns=["system", "level"] + ['score_metricx_both', 'score_xcomet_both', 'score_CHRFpp', 'score_glotlid_ref'],
415
+ # filter_columns=["system", "level"],
416
+ # )
417
+ gr.Dataframe(df)
418
 
419
  with gr.Blocks(
420
  css="""
 
439
 
440
  if __name__ == "__main__":
441
  demo.launch()
 
data/benchmark_stats.tsv ADDED
The diff for this file is too large to render. See raw diff
 
requirements.txt CHANGED
@@ -1,2 +1,4 @@
1
  argilla
2
  gradio[oauth]
 
 
 
1
  argilla
2
  gradio[oauth]
3
+ pandas
4
+ gradio_leaderboard