Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created July 20, 2021 11:20
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/a2dc5ba5fca9d666c0f63cfb1e85705e to your computer and use it in GitHub Desktop.
Save amankharwal/a2dc5ba5fca9d666c0f63cfb1e85705e to your computer and use it in GitHub Desktop.
sentiments = SentimentIntensityAnalyzer()
data["Positive"] = [sentiments.polarity_scores(i)["pos"] for i in data["Text"]]
data["Negative"] = [sentiments.polarity_scores(i)["neg"] for i in data["Text"]]
data["Neutral"] = [sentiments.polarity_scores(i)["neu"] for i in data["Text"]]
print(data.head())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment