1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 9.7 Á¤º¸¸¦ ÇÑ´«¿¡ º¸¿©ÁÖ´Â ¿öµå Ŭ¶ó¿ìµå, 233ÂÊ # import wikipedia from wordcloud import WordCloud, STOPWORDS import matplotlib.pyplot as plt # À§Å°¹é°ú »çÀüÀÇ ÄÁÅÙÃ÷ Á¦¸ñÀ» ¸í½ÃÇØ ÁØ´Ù wiki = wikipedia.page('Python') # ÀÌ ÆäÀÌÁöÀÇ ÅؽºÆ® ÄÁÅÙÃ÷¸¦ ÃßÃâÇϵµ·Ï ÇÑ´Ù text = wiki.content # ¿öµå Ŭ¶ó¿ìµå¸¦ »ý¼ºÇϱâ À§ÇØ À§ÀÇ Äڵ带 »ðÀÔÇÒ °Í wordcloud = WordCloud(width = 2000, height = 1500, stopwords = STOPWORDS).generate(text) plt.figure(figsize=(40, 30)) # ȸ鿡 À̹ÌÁö¸¦ ±×·ÁÁØ´Ù plt.imshow(wordcloud) plt.show() | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 9.7 Á¤º¸¸¦ ÇÑ´«¿¡ º¸¿©ÁÖ´Â ¿öµå Ŭ¶ó¿ìµå, 233ÂÊ # import wikipedia from wordcloud import WordCloud, STOPWORDS import matplotlib.pyplot as plt # À§Å°¹é°ú »çÀüÀÇ ÄÁÅÙÃ÷ Á¦¸ñÀ» ¸í½ÃÇØ ÁØ´Ù wiki = wikipedia.page('machinelearning') # ÀÌ ÆäÀÌÁöÀÇ ÅؽºÆ® ÄÁÅÙÃ÷¸¦ ÃßÃâÇϵµ·Ï ÇÑ´Ù text = wiki.content # ¿öµå Ŭ¶ó¿ìµå¸¦ »ý¼ºÇϱâ À§ÇØ À§ÀÇ Äڵ带 »ðÀÔÇÒ °Í wordcloud = WordCloud(width = 2000, height = 1500, stopwords = STOPWORDS).generate(text) plt.figure(figsize=(40, 30)) # ȸ鿡 À̹ÌÁö¸¦ ±×·ÁÁØ´Ù plt.imshow(wordcloud) plt.show() | cs |