from transformers import pipeline import gradio as gr # Chargement du pipeline d'analyse de sentiment sentiment = pipeline("sentiment-analysis") # Fonction pour prédire le sentiment def predict(review): result = sentiment(review)[0] return f"Sentiment : {result['label']}, confiance {result['score']:.2f}" # Interface Gradio gr.Interface(fn=predict, inputs="text", outputs="text").launch()