Magali/sentiment
0
1import nltk2 3from nltk.sentiment.vader import SentimentIntensityAnalyzer4 5import gradio as gr6 7 8nltk.download("vader_lexicon")9sid = SentimentIntensityAnalyzer()10 11def sentiment_analysis(text):12 scores = sid.polarity_scores(text)13 del scores["compound"]14 return scores15 16iface = gr.Interface(sentiment_analysis, "textbox", "label", interpretation="default")17 18iface.test_launch()19if __name__ == "__main__":20 iface.launch()