Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created April 9, 2021 09: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 amankharwal/a79416c56c3079be3fd53ab8ea394fcf to your computer and use it in GitHub Desktop.
Save amankharwal/a79416c56c3079be3fd53ab8ea394fcf to your computer and use it in GitHub Desktop.
text = " ".join(review for review in messages_df.Message)
print ("There are {} words in all the messages.".format(len(text)))
stopwords = set(STOPWORDS)
# Generate a word cloud image
wordcloud = WordCloud(stopwords=stopwords, background_color="white").generate(text)
# Display the generated image:
# the matplotlib way:
plt.figure( figsize=(10,5))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment