Datatrooper/sentimiento
2
1from pysentimiento import create_analyzer2 3 4import gradio as gr5 6analyzer = create_analyzer(task="sentiment", lang="es")7 8def sentiment_analysis(text):9 10 sent = analyzer.predict(text).probas11 return sent12 13iface = gr.Interface(sentiment_analysis, 14 "textbox", 15 "label", 16 interpretation="default",17 title="Spanish Sentiment Analysis",18 description="Write a sentence in spanish to analyze its sentiment")19 20iface.test_launch()21if __name__ == "__main__":22 iface.launch()