Spaces:
Runtime error
Runtime error
siddhantuniyal
commited on
Commit
•
95c55d3
1
Parent(s):
191139c
Update app.py
Browse files
app.py
CHANGED
@@ -28,12 +28,20 @@ def spam_detection(input_text):
|
|
28 |
def sentiment_analysis(input_text):
|
29 |
|
30 |
score = SentimentIntensityAnalyzer().polarity_scores(input_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
if
|
33 |
|
34 |
return ["Negative Feedback" , score['neg']]
|
35 |
|
36 |
-
elif
|
37 |
|
38 |
return ["Positive Feedback" , -1]
|
39 |
|
|
|
28 |
def sentiment_analysis(input_text):
|
29 |
|
30 |
score = SentimentIntensityAnalyzer().polarity_scores(input_text)
|
31 |
+
|
32 |
+
|
33 |
+
del score['compound']
|
34 |
+
|
35 |
+
label = list(filter(lambda x: score[x] == max(score.values()), score))[0]
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
|
40 |
+
if label == 'neg':
|
41 |
|
42 |
return ["Negative Feedback" , score['neg']]
|
43 |
|
44 |
+
elif label == 'pos':
|
45 |
|
46 |
return ["Positive Feedback" , -1]
|
47 |
|