CoolFace
Apppublic

Datatrooper/sentimiento

sourceHugging Faceupdated 4y agoView on Hugging Face
2likes
app.py22 linesDownload Raw Back to root
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()