Update app.py
Browse files
app.py
CHANGED
@@ -212,31 +212,60 @@ with gr.Blocks(title="Bambara ASR Leaderboard") as demo:
|
|
212 |
gr.Markdown(
|
213 |
"""
|
214 |
# Bambara ASR Leaderboard
|
215 |
-
Upload a CSV file with 'id' and 'text' columns to evaluate your ASR predictions.
|
216 |
-
The 'id's must match those in the dataset.
|
217 |
|
218 |
-
|
219 |
-
|
220 |
"""
|
221 |
)
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
# Print startup message
|
242 |
print("Starting Bambara ASR Leaderboard app...")
|
|
|
212 |
gr.Markdown(
|
213 |
"""
|
214 |
# Bambara ASR Leaderboard
|
|
|
|
|
215 |
|
216 |
+
This leaderboard ranks and evaluates speech recognition models for the Bambara language.
|
217 |
+
Models are ranked based on their Word Error Rate (WER), from lowest to highest.
|
218 |
"""
|
219 |
)
|
220 |
|
221 |
+
# Load and display current leaderboard immediately
|
222 |
+
with gr.Tabs() as tabs:
|
223 |
+
with gr.TabItem("π
Current Rankings"):
|
224 |
+
# Show current leaderboard rankings
|
225 |
+
current_leaderboard = pd.read_csv(leaderboard_file).sort_values("WER")
|
226 |
+
|
227 |
+
gr.Markdown("### Current ASR Model Rankings")
|
228 |
+
leaderboard_view = gr.DataFrame(
|
229 |
+
value=current_leaderboard,
|
230 |
+
interactive=False,
|
231 |
+
label="Models are ranked by Word Error Rate (WER) - lower is better"
|
232 |
+
)
|
233 |
+
|
234 |
+
gr.Markdown(
|
235 |
+
"""
|
236 |
+
## Metrics Explanation
|
237 |
+
- **WER**: Word Error Rate (lower is better) - measures word-level accuracy
|
238 |
+
- **CER**: Character Error Rate (lower is better) - measures character-level accuracy
|
239 |
+
"""
|
240 |
+
)
|
241 |
|
242 |
+
with gr.TabItem("π Submit New Results"):
|
243 |
+
gr.Markdown(
|
244 |
+
"""
|
245 |
+
### Submit a new model for evaluation
|
246 |
+
|
247 |
+
Upload a CSV file with 'id' and 'text' columns to evaluate your ASR predictions.
|
248 |
+
The 'id's must match those in the reference dataset.
|
249 |
+
"""
|
250 |
+
)
|
251 |
+
|
252 |
+
with gr.Row():
|
253 |
+
submitter = gr.Textbox(label="Submitter Name or Model Name", placeholder="e.g., MALIBA-AI/asr")
|
254 |
+
csv_upload = gr.File(label="Upload CSV File", file_types=[".csv"])
|
255 |
+
|
256 |
+
submit_btn = gr.Button("Submit")
|
257 |
+
output_msg = gr.Textbox(label="Status", interactive=False)
|
258 |
+
leaderboard_display = gr.DataFrame(
|
259 |
+
label="Updated Leaderboard",
|
260 |
+
value=current_leaderboard,
|
261 |
+
interactive=False
|
262 |
+
)
|
263 |
+
|
264 |
+
submit_btn.click(
|
265 |
+
fn=process_submission,
|
266 |
+
inputs=[submitter, csv_upload],
|
267 |
+
outputs=[output_msg, leaderboard_display]
|
268 |
+
)
|
269 |
|
270 |
# Print startup message
|
271 |
print("Starting Bambara ASR Leaderboard app...")
|