Spaces:
Sleeping
Sleeping
| from transformers import pipeline,AutoTokenizer, AutoModelForSequenceClassification | |
| import gradio as gr | |
| pipe = pipeline("text-classification", model="Taraassss/sentiment_analysis_IT") | |
| def sentiment_analysis(text): | |
| result = pipe(text) | |
| sentiment = result[0]['label'] | |
| score = result[0]['score'] | |
| return f"Sentiment: {sentiment}, Confidence: {score:.2f}" | |
| iface = gr.Interface( | |
| fn=sentiment_analysis, | |
| inputs=gr.Textbox(lines=2, placeholder="Inserisci il testo da analizzare..."), | |
| outputs="text", | |
| title="Analisi del Sentimento Italiano", | |
| description="Inserisci una frase in italiano per analizzare il sentimento.", | |
| ) | |
| iface.launch() | |