RodrigoGariv commited on
Commit
b56f666
·
verified ·
1 Parent(s): 44331d9

Create app.py

Browse files

primera version

Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ clasificador = pipeline("sentiment-analysis")
5
+
6
+ def predecir(texto):
7
+ resultado = clasificador(texto)[0]
8
+ return f"Etiqueta: {resultado['label']} | Confianza: {round(resultado['score'], 2)}"
9
+
10
+ interfaz = gr.Interface(fn=predecir, inputs="text", outputs="text", title="Análisis de Sentimientos")
11
+ interfaz.launch(server_name="0.0.0.0", server_port=7860)