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