import csv from collections import defaultdict import gradio as gr import pandas as pd def strip_colname(x): if x.startswith("score_"): return x[6:] return x INTRO = """The current leaderboard displays performance across all filtered directions based on the dev subset of BOUQuET. A smarter leaderboard and the code for reproducing the evaluations will be published soon! """ LANGS_EXPLANATION = """## Languages Below, we give a brief description of each language variety participating in the leaderboard. Each language variety is identified by an [ISO 639-3 code](https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes) (the first 3 letters) for the language, an [ISO 15924](https://en.wikipedia.org/wiki/ISO_15924) code (the next 4 letters) for the writing system, and optionally, a [Glottolog code](https://glottolog.org/) for the dialect. The varieties with a secondary language code (Egyptian Arabic, Colloquial Malay) use code-switching, i.e. the speakers switch between the two languages (a colloquial and a standardized variety) depending on the context (e.g. the formality level). For a fuller description of the languages and the codes used to represent them, please refer to https://huggingface.co/datasets/facebook/bouquet#languages and the [BOUQuET paper](https://arxiv.org/abs/2502.04314). """ def languages_tab(): langs_df = pd.read_csv("data/language_metadata.tsv", sep="\t") with gr.Tab("Languages"): gr.Markdown("# BOUQuET languages list") gr.Markdown(LANGS_EXPLANATION) gr.Dataframe(langs_df.style.format(na_rep=""))