Skip to content

Instantly share code, notes, and snippets.

@mlai-demo
Last active January 11, 2020 23:16
Show Gist options
  • Save mlai-demo/4ebd22e29211162d39679edc0ef05a83 to your computer and use it in GitHub Desktop.
Save mlai-demo/4ebd22e29211162d39679edc0ef05a83 to your computer and use it in GitHub Desktop.
Russell word cloud lemmatized
import pandas as pd
from wordcloud import WordCloud
import matplotlib.pyplot as plt
stemmed_text = open('TextsPub/Russell_lemma.txt').read()
wordcloud = WordCloud(stopwords=my_stop_words,
max_font_size=400,
width=2500,
height=2000,
random_state=64,
).generate(stemmed_text)
fig = plt.figure().set_size_inches(16, 16)
plt.imshow(wordcloud, interpolation="bilinear")
plt.axis("off")
plt.title('Bertrand Russell Wordcloud', fontsize= 20)
plt.xlabel("size", fontsize= 12)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment