Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Abhayparashar31/1d1cb11a2bc5e5d8cc762e85dbccf1f4 to your computer and use it in GitHub Desktop.
Save Abhayparashar31/1d1cb11a2bc5e5d8cc762e85dbccf1f4 to your computer and use it in GitHub Desktop.
import streamlit as st
import nltk
from nltk.sentiment.vader import SentimentIntensityAnalyzer
nltk.download('vader_lexicon')
st.write(" Real Time Sentiment Analyzer ")
input = st.text_input("Enter Your Review...")
score = SentimentIntensityAnalyzer().polarity_scores(input)
if score==0: st.write("Neutral")
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