Spaces:
Sleeping
Sleeping
First commit app.py
Browse files
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)
|