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