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() |