Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,24 +59,42 @@ def main():
|
|
59 |
with gr.Blocks() as demo:
|
60 |
gr.Markdown("# Aplicaci贸n de Clasificaci贸n y Traducci贸n")
|
61 |
|
62 |
-
with gr.TabbedInterface(
|
63 |
-
|
64 |
-
gr.
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
boton_traducir = gr.Button("Traducir")
|
79 |
-
boton_traducir.click(fn=traducir_texto_en_es, inputs=input_texto_traduccion, outputs=output_traduccion, api_name="translate")
|
80 |
|
81 |
demo.launch()
|
82 |
|
|
|
59 |
with gr.Blocks() as demo:
|
60 |
gr.Markdown("# Aplicaci贸n de Clasificaci贸n y Traducci贸n")
|
61 |
|
62 |
+
with gr.TabbedInterface(
|
63 |
+
[
|
64 |
+
gr.Column(
|
65 |
+
[
|
66 |
+
gr.Markdown("## Clasificaci贸n de Noticias"),
|
67 |
+
input_texto_clasificacion,
|
68 |
+
modelo_seleccion,
|
69 |
+
boton_clasificar,
|
70 |
+
output_clasificacion,
|
71 |
+
],
|
72 |
+
label="Clasificaci贸n de Noticias",
|
73 |
+
),
|
74 |
+
gr.Column(
|
75 |
+
[
|
76 |
+
gr.Markdown("## Traducci贸n de Ingl茅s a Espa帽ol"),
|
77 |
+
input_texto_traduccion,
|
78 |
+
boton_traducir,
|
79 |
+
output_traduccion,
|
80 |
+
],
|
81 |
+
label="Traducci贸n (Ingl茅s a Espa帽ol)",
|
82 |
+
),
|
83 |
+
]
|
84 |
+
) as tabs:
|
85 |
+
input_texto_clasificacion = gr.Textbox(label="Ingresa la noticia aqu铆:")
|
86 |
+
modelo_seleccion = gr.Dropdown(
|
87 |
+
["Transformer Encoder Apilado", "Transformer Positional Encoding", "Simple RNN", "LSTM"],
|
88 |
+
label="Selecciona el modelo:"
|
89 |
+
)
|
90 |
+
output_clasificacion = gr.Textbox(label="Resultado de la clasificaci贸n:")
|
91 |
+
boton_clasificar = gr.Button("Clasificar")
|
92 |
+
boton_clasificar.click(fn=clasificar_noticia, inputs=[input_texto_clasificacion, modelo_seleccion], outputs=output_clasificacion)
|
93 |
|
94 |
+
input_texto_traduccion = gr.Textbox(label="Ingresa el texto en ingl茅s:")
|
95 |
+
output_traduccion = gr.Textbox(label="Texto traducido al espa帽ol:")
|
96 |
+
boton_traducir = gr.Button("Traducir")
|
97 |
+
boton_traducir.click(fn=traducir_texto_en_es, inputs=input_texto_traduccion, outputs=output_traduccion)
|
|
|
|
|
98 |
|
99 |
demo.launch()
|
100 |
|