Magali commited on
Commit
50e0ebf
·
1 Parent(s): 0d873ef

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mport gradio as gr
2
+
3
+ nltk.download("vader_lexicon")
4
+ sid = SentimentIntensityAnalyzer()
5
+
6
+ def sentiment_analysis(text):
7
+ scores = sid.polarity_scores(text)
8
+ del scores["compound"]
9
+ return scores
10
+
11
+ iface = gr.Interface(sentiment_analysis, "textbox", "label", interpretation="default")
12
+
13
+ iface.test_launch()
14
+ if __name__ == "__main__":
15
+ iface.launch()