Skip to content

Instantly share code, notes, and snippets.

@liannewriting
Created September 6, 2020 17:25
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/9a13e34fceb899ca57846040abc47c24 to your computer and use it in GitHub Desktop.
Save liannewriting/9a13e34fceb899ca57846040abc47c24 to your computer and use it in GitHub Desktop.
Twitter sentiment analysis python
for i, t in enumerate(pos_thresholds):
pos_pred = df_labelled['textblob_sentiment'] > t
acc = accuracy_score(df_labelled['is_pos'], pos_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