File size: 476 Bytes
56d146b
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
from nltk.sentiment.vader import SentimentIntensityAnalyzer

def sentiment_analysis(sentiment_text):
    score = SentimentIntensityAnalyzer().polarity_scores(sentiment_text)
    if score['neg']>score['pos']:
        return "Negative Feedback"
    elif score['neg']<score['pos']:
        return "Positive Feedback"
    else:
        return "Neutral Feedback"

iface = gr.Interface(fn = sentiment_analysis , inputs=['text'] , outputs=['text'])
iface.launch()