File size: 3,194 Bytes
1dc0a7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr # needs to be installed

from dataset import Dataset


dataset = Dataset()


def eval(data_subset:str, model_1:str, model_2:str, model_3:str)->str:

    result = f"""# HELLO THERE
    Data Subset: {data_subset}
    Model 1: {model_1}
    Model 2: {model_2}
    Model_3: {model_3}
    """
    return result

def get_card(selected_model:str)->str:

    if selected_model == "None":
        return ""
    elif selected_model == "Model2":
        return "A very good model indeed"
    elif selected_model == "Model3":
        return "Also very good"
    else:
        return "Unknown Model"

def is_own(data_subset:str):
    if data_subset == "own":
        own_audio = gr.Audio(sources=['microphone'],streaming=False)
        own_transcription = gr.TextArea(lines=2)
        return own_audio, own_transcription
    own_audio = None
    own_transcription = None
    return own_audio, own_transcription

with gr.Blocks() as app:

    gr.Markdown("# VocalVenturer 💬")
    gr.Markdown("-------")
    gr.Markdown("""
                Hello there, this is the VocalVenturer, this app is aimed at helping you making more informed model choices for ASR. 
                Please choose a Data Subset to evalutate the Models on. You also have the opportunity to record and transcibe an own sample. 
                The Models will be evaluated using the *WER* metric -> here is an amazing Leaderboard for it LINK""")

    with gr.Row():
        with gr.Column(scale=1):
            pass
        with gr.Column(scale=3):
            data_subset = gr.Radio(
                value="Libris",
                choices=["Libris","Common","own"],
                label="Data subset / Own Sample",
            )
        with gr.Column(scale=1):
            pass

    with gr.Row():
        own_audio = gr.Audio(sources=['microphone'],streaming=False,visible=False)
        own_transcription = gr.TextArea(lines=2, visible=False)

        data_subset.change(is_own, inputs=[data_subset], outputs=[own_audio, own_transcription])


    with gr.Row():

        with gr.Column(scale=1):
            model_1 = gr.Dropdown(
                choices=["None","Model2","Model3"],
                label="Select Model 1"
            )
            model_1_card = gr.Markdown("")

        with gr.Column(scale=1):
            model_2 = gr.Dropdown(
                choices=["None","Model2","Model3"],
                label="Select Model 2"
            )
            model_2_card = gr.Markdown("")

        with gr.Column(scale=1):
            model_3 = gr.Dropdown(
                choices=["None","Model2","Model3"],
                label="Select Model 3"
            )
            model_3_card = gr.Markdown("")

        model_1.change(get_card, inputs=model_1, outputs=model_1_card)
        model_2.change(get_card, inputs=model_2, outputs=model_2_card)
        model_3.change(get_card, inputs=model_3, outputs=model_3_card)

    eval_btn = gr.Button(
        value="Evaluate",
        variant="primary"
    )

    

    gr.Markdown("-------")
    gr.Markdown("### Results")

    results = gr.Markdown("")

    eval_btn.click(eval, [data_subset, model_1, model_2, model_3], results)

app.launch(debug=True)