shubhamjaiswar
commited on
Commit
•
56d146b
1
Parent(s):
8b7672a
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from nltk.sentiment.vader import SentimentIntensityAnalyzer
|
3 |
+
|
4 |
+
def sentiment_analysis(sentiment_text):
|
5 |
+
score = SentimentIntensityAnalyzer().polarity_scores(sentiment_text)
|
6 |
+
if score['neg']>score['pos']:
|
7 |
+
return "Negative Feedback"
|
8 |
+
elif score['neg']<score['pos']:
|
9 |
+
return "Positive Feedback"
|
10 |
+
else:
|
11 |
+
return "Neutral Feedback"
|
12 |
+
|
13 |
+
iface = gr.Interface(fn = sentiment_analysis , inputs=['text'] , outputs=['text'])
|
14 |
+
iface.launch()
|