RodrigoGariv's picture
Create app.py
b56f666 verified
raw
history blame contribute delete
411 Bytes
from transformers import pipeline
import gradio as gr
clasificador = pipeline("sentiment-analysis")
def predecir(texto):
resultado = clasificador(texto)[0]
return f"Etiqueta: {resultado['label']} | Confianza: {round(resultado['score'], 2)}"
interfaz = gr.Interface(fn=predecir, inputs="text", outputs="text", title="Análisis de Sentimientos")
interfaz.launch(server_name="0.0.0.0", server_port=7860)