Spaces:
Runtime error
Runtime error
File size: 4,821 Bytes
a0497a5 3aae85b b8e8c93 82d6c9a 3aae85b b8e8c93 3aae85b b8e8c93 a0497a5 3aae85b 743aac4 8b42620 3aae85b 8b42620 3aae85b d38c074 3aae85b a0497a5 82d6c9a 8a7bf5e 82d6c9a a0497a5 82d6c9a 3aae85b 82d6c9a b8e8c93 a0497a5 3aae85b 743aac4 3aae85b a0497a5 b8e8c93 a0497a5 3aae85b 8b42620 3aae85b 743aac4 3aae85b a0497a5 b8e8c93 a0497a5 3aae85b 743aac4 8b42620 743aac4 3aae85b 743aac4 3aae85b 743aac4 3aae85b 8b42620 3aae85b a0497a5 b8e8c93 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
import gradio as gr
import pandas as pd
dataframe = pd.read_csv('data/general.csv')
NUM_DATASETS = 7
NUM_SCORES = 0
NUM_MODELS = len(dataframe)
def general_dataframe_update():
"""
Returns general dataframe for general table.
"""
dataframe = pd.read_csv('data/general.csv')
return dataframe
def classification_dataframe_update():
"""
Returns classification dataframe for classification table.
"""
dataframe = pd.read_csv('data/classification.csv')
return dataframe
def sts_dataframe_udpate():
"""
Returns sts dataframe for sts table.
"""
dataframe = pd.read_csv('data/sts.csv')
return dataframe
def clustering_dataframe_update():
"""
Returns clustering dataframe for clustering table.
"""
dataframe = pd.read_csv("data/clustering.csv")
return dataframe
def retrieval_dataframe_update():
"""
Returns retrieval dataframe for retrieval table.
"""
dataframe = pd.read_csv('data/retrieval.csv')
return dataframe
def make_clickable_model(link):
"""
Load json from models. Este update lo tengo que hacer antes de pasarle el df al gradio.
"""
model_display_name = link.split("/")[-1]
# Remove user from model name
return (
f'<a target="_blank" style="text-decoration: underline" href="{link}">{model_display_name.split("/")[-1]}</a>'
)
block = gr.Blocks()
with block:
gr.Markdown(f"""**Leaderboard de modelos de Embeddings en español
Massive Spanish Text Embedding Benchmark (MSTEB) Leaderboard.**
- **Total Datasets**: {NUM_DATASETS}
- **Total Languages**: 1
- **Total Scores**: {NUM_SCORES}
- **Total Models**: {NUM_MODELS}
""")
with gr.Tabs():
with gr.TabItem("Overall"):
with gr.Row():
gr.Markdown("""
**Tabla General de Embeddings**
- **Métricas:** Varias, con sus respectivas medias.
- **Idioma:** Español
""")
with gr.Row():
overall = general_dataframe_update()
data_overall = gr.components.Dataframe(
overall,
type="pandas",
wrap=True,
)
with gr.TabItem("Classification"):
with gr.Row():
gr.Markdown("""
**Tabla Classification de Embeddings**
- **Métricas:** Accuracy.
- **Idioma:** Español
""")
with gr.Row():
# Create and display a sample DataFrame
classification = classification_dataframe_update()
data_overall = gr.components.Dataframe(
classification,
type="pandas",
wrap=True,
)
with gr.TabItem("STS"):
with gr.Row():
gr.Markdown("""
**Tabla STS de Embeddings**
- **Metricas:** Spearman correlation basada en cosine similarity.
- **Idioma:** Español
""")
with gr.Row():
# Create and display a sample DataFrame
sts = sts_dataframe_udpate()
data_overall = gr.components.Dataframe(
sts,
type="pandas",
wrap=True,
)
with gr.TabItem("Clustering"):
with gr.Row():
gr.Markdown("""
**Tabla Clustering de Embeddings**
- **Metricas:** V_measure.
- **Idioma:** Español
""")
with gr.Row():
# Create and display a sample DataFrame
clustering = clustering_dataframe_update()
data_overall = gr.components.Dataframe(
clustering,
type="pandas",
wrap=True,
)
with gr.TabItem("Retrieval"):
with gr.Row():
gr.Markdown("""
**Tabla Retrieval de Embeddings**
- **Metricas:** ncdg_10.
- **Idioma:** Español
""")
with gr.Row():
# Create and display a sample DataFrame
sts = retrieval_dataframe_update()
data_overall = gr.components.Dataframe(
sts,
type="pandas",
wrap=True,
)
block.launch()
|