Owen commited on
Commit
a2d9b4e
Β·
1 Parent(s): e7780e3

update evaluation plot

Browse files
Files changed (1) hide show
  1. app.py +43 -29
app.py CHANGED
@@ -4,6 +4,7 @@ import torch.nn as nn
4
  import torchaudio
5
  import numpy as np # type: ignore
6
  import gradio as gr # type: ignore
 
7
  from transformers import pipeline
8
  from huggingface_hub import hf_hub_download
9
  from torchaudio.models import Conformer
@@ -220,37 +221,50 @@ with gr.Blocks() as tab_architecture:
220
  gr.Image("conformer.png", show_label=False, show_download_button=False)
221
 
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  # --- Tab 4: Tabel Hasil Evaluasi ---
224
  with gr.Blocks() as tab_results:
225
- gr.HTML("""
226
- <h1 style='text-align:center;'>πŸ“Š Hasil Evaluasi Model</h1>
227
- <table style="width:80%; margin:20px auto; border-collapse:separate; border-spacing:0; font-family:sans-serif;">
228
- <thead style="background-color:#eb7434; color:white;">
229
- <tr>
230
- <th style="padding:15px 20px; text-align:center;">Dataset</th>
231
- <th style="padding:15px 20px; text-align:center;">WER (Word Error Rate)</th>
232
- <th style="padding:15px 20px; text-align:center;">CER (Character Error Rate)</th>
233
- </tr>
234
- </thead>
235
- <tbody>
236
- <tr>
237
- <td style="padding:15px 20px; text-align:center;">SLR35 (Javanese)</td>
238
- <td style="padding:15px 20px; text-align:center;">15.2%</td>
239
- <td style="padding:15px 20px; text-align:center;">9.8%</td>
240
- </tr>
241
- <tr>
242
- <td style="padding:15px 20px; text-align:center;">SLR41 (Indonesian)</td>
243
- <td style="padding:15px 20px; text-align:center;">12.4%</td>
244
- <td style="padding:15px 20px; text-align:center;">8.1%</td>
245
- </tr>
246
- <tr>
247
- <td style="padding:15px 20px; text-align:center;">SLR44 (Multilingual)</td>
248
- <td style="padding:15px 20px; text-align:center;">17.3%</td>
249
- <td style="padding:15px 20px; text-align:center;">11.0%</td>
250
- </tr>
251
- </tbody>
252
- </table>
253
- """)
254
 
255
  # --- Tab 5: Fine-tuning Info ---
256
  with gr.Blocks() as tab_authors:
 
4
  import torchaudio
5
  import numpy as np # type: ignore
6
  import gradio as gr # type: ignore
7
+ import pandas as pd
8
  from transformers import pipeline
9
  from huggingface_hub import hf_hub_download
10
  from torchaudio.models import Conformer
 
221
  gr.Image("conformer.png", show_label=False, show_download_button=False)
222
 
223
 
224
+ import gradio as gr
225
+ import pandas as pd
226
+
227
+ data_wer = {
228
+ "Model": ["Whisper", "Conformer"],
229
+ "WER": [11, 50],
230
+ }
231
+
232
+ data_cer = {
233
+ "Model": ["Whisper", "Conformer"],
234
+ 'CER': [0, 20]
235
+ }
236
+
237
+ df_WER = pd.DataFrame(data_wer)
238
+ df_CER = pd.DataFrame(data_cer)
239
+
240
  # --- Tab 4: Tabel Hasil Evaluasi ---
241
  with gr.Blocks() as tab_results:
242
+ gr.Markdown("## πŸ“Š Best Error Rate (WER / CER)")
243
+ with gr.Row():
244
+ gr.BarPlot(
245
+ df_WER,
246
+ x="Model",
247
+ y="WER",
248
+ title="Best WER by Model",
249
+ tooltip=["Model", "WER"],
250
+ y_lim=(0, 100),
251
+ container=False,
252
+ height=400,
253
+ width=300
254
+ )
255
+
256
+ gr.BarPlot(
257
+ df_CER,
258
+ x="Model",
259
+ y="CER",
260
+ title="Best CER by Model",
261
+ tooltip=["Model", "CER"],
262
+ y_lim=(0, 100),
263
+ container=False,
264
+ height=400,
265
+ width=300
266
+ )
267
+
 
 
 
268
 
269
  # --- Tab 5: Fine-tuning Info ---
270
  with gr.Blocks() as tab_authors: