Skip to content

Instantly share code, notes, and snippets.

@liannewriting
Created September 6, 2020 17:24
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 liannewriting/e6bb3387e3d74bcaf93be2bcb52bf4f3 to your computer and use it in GitHub Desktop.
Save liannewriting/e6bb3387e3d74bcaf93be2bcb52bf4f3 to your computer and use it in GitHub Desktop.
Twitter sentiment analysis python
for i, t in enumerate(neg_thresholds):
neg_pred = -df_labelled['textblob_sentiment'] > t
acc = accuracy_score(df_labelled['is_neg'], neg_pred)
print('threshold: {}, accuracy: {}'.format(-t, acc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment