Last active
May 25, 2022 07:47
-
-
Save YHaruoka/a3f863d16c7d57f7fc63d0f8564bfcb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wordcloud import WordCloud | |
import matplotlib.pyplot as plt | |
stop_words = ["based", "using", "via", "for", "with", "on", "in", "of", "a", "and", "the", "to", "from", "by", "method", "non", "an", "toward","towards"] | |
text = open("test.txt",encoding='utf-8').read() | |
wordcloud = WordCloud(width=1920, height=1080, max_words=50,background_color="black", stopwords=stop_words, max_font_size=250).generate(text) | |
wordcloud.to_file("word_cloud_result.png") | |
plt.imshow(wordcloud) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment