Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created September 13, 2021 10:04
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/ce4db40b07d649c4fb5658e2e00533eb to your computer and use it in GitHub Desktop.
Save amankharwal/ce4db40b07d649c4fb5658e2e00533eb to your computer and use it in GitHub Desktop.
from nltk.sentiment.vader import SentimentIntensityAnalyzer
nltk.download('vader_lexicon')
sentiments = SentimentIntensityAnalyzer()
data["Positive"] = [sentiments.polarity_scores(i)["pos"] for i in data["tweet"]]
data["Negative"] = [sentiments.polarity_scores(i)["neg"] for i in data["tweet"]]
data["Neutral"] = [sentiments.polarity_scores(i)["neu"] for i in data["tweet"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment