Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Mar 19, 2021
Embed
What would you like to do?
import streamlit as st
import nltk
from nltk.sentiment.vader import SentimentIntensityAnalyzer
st.write("# Real Time Sentiment Analysis")
user_input = st.text_input("Please rate our services >>: ")
nltk.download("vader_lexicon")
s = SentimentIntensityAnalyzer()
score = s.polarity_scores(user_input)
if score == 0:
st.write(" ")
elif score["neg"] != 0:
st.write("# Negative")
elif score["pos"] != 0:
st.write("# Positive")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment