Update app.py
Browse files
app.py
CHANGED
@@ -23,29 +23,27 @@ def get_shared_text():
|
|
23 |
return shared_text
|
24 |
|
25 |
with demo:
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
b1.click(audio_a_texto, inputs=audio_input, outputs=texto_output)
|
49 |
-
b2.click(texto_a_sentimiento, inputs=texto_input, outputs=sentimiento_output)
|
50 |
|
51 |
demo.launch()
|
|
|
23 |
return shared_text
|
24 |
|
25 |
with demo:
|
26 |
+
gr.Markdown("## Transcribe audio2text and sentimental classification - Spanish")
|
27 |
+
with gr.Tabs():
|
28 |
+
with gr.TabItem("Transcribe"):
|
29 |
+
with gr.Row():
|
30 |
+
audio_input = gr.Audio(sources=["microphone"], type="filepath")
|
31 |
+
texto_output = gr.Textbox(label="Audio to text", value=shared_text)
|
32 |
+
texto_output.change(fn=update_text, inputs=texto_output, outputs=texto_output)
|
33 |
+
with gr.Row():
|
34 |
+
b1 = gr.Button("Transcribe ποΈβπ»")
|
35 |
+
with gr.TabItem("Sentimental Classification"):
|
36 |
+
with gr.Row():
|
37 |
+
texto_input = gr.Textbox(label="Text to sentimental", value=shared_text)
|
38 |
+
texto_input.change(fn=update_text, inputs=texto_input, outputs=texto_input)
|
39 |
+
sentimiento_output = gr.Label()
|
40 |
+
with gr.Row():
|
41 |
+
b2 = gr.Button("Sentimental Classification π€")
|
42 |
+
|
43 |
+
# Keep the 2 text box with the same text.
|
44 |
+
texto_input.change(fn=get_shared_text, inputs=None, outputs=texto_input)
|
45 |
+
texto_output.change(fn=get_shared_text, inputs=None, outputs=texto_output)
|
46 |
+
b1.click(audio_a_texto, inputs=audio_input, outputs=texto_output)
|
47 |
+
b2.click(texto_a_sentimiento, inputs=texto_input, outputs=sentimiento_output)
|
|
|
|
|
48 |
|
49 |
demo.launch()
|