Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created March 19, 2021 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/527d579205be791e82b45190568799b6 to your computer and use it in GitHub Desktop.
Save amankharwal/527d579205be791e82b45190568799b6 to your computer and use it in GitHub Desktop.
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