Skip to content

Instantly share code, notes, and snippets.

@josht-jpg
Last active September 4, 2020 20:12
Show Gist options
  • Save josht-jpg/8c305d3464510e2763458b7eb9854623 to your computer and use it in GitHub Desktop.
Save josht-jpg/8c305d3464510e2763458b7eb9854623 to your computer and use it in GitHub Desktop.
Sample AFINN
books_raw = pd.Series(books_raw)
books = books_raw.apply(get_book_contents)
books_bigrams = books.apply(bigram)
books_afinn = books_bigrams.apply(afinn_context)
books_means = books_afinn.apply(lambda x: x['score'].mean())
print(books_means.min(), books_means.max(), books_means.mean(), books_means.std())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment