파이썬(Python)을 이용해 간단하게 워드클라우드를 구현하는 예제입니다. 예제 실습 코드는 포스팅 하단에 있으니 참고하기 바랍니다. 그 외 참고하면 좋은 웹사이트와 블로그 링크도 함께 첨부하니 각자 연습해 보기 바랍니다.
코딩하지 않고 한글 워드 클라우드 무료로 만들기
이전 포스팅에서도 R 혹은 Python처럼 코딩하지 않고 워드 클라우드를 만드는 서비스 혹은 방법에 관하여 소개한 바 있습니다만, 해당 포스팅에서 소개하지 않았던 2가지 서비스를 정리하겠습니
e-datanews.tistory.com
코딩하지 않고 무료로 일본어 워드 클라우드 만들기 │lab.fanbright.jp
코딩하지 않고 무료로 일본어 워드 클라우드를 만들어 보겠습니다. 코딩하지 않고 무료로 만들기 때문에 몇 가지 제약 사항이 있다는 점은 미리 말씀드립니다. 이전 포스팅에서 코딩하지 않고,
e-datanews.tistory.com
파이썬(Python)을 이용한 워드클라우드 구현
아래 코드 순서대로 따라하면 그림과 같은 워드클라우드를 구현할 수 있습니다.
pip install wordcloud
Requirement already satisfied: wordcloud in c:\users\e-dat\anaconda3\lib\site-packages (1.8.2.2)
Requirement already satisfied: numpy>=1.6.1 in c:\users\e-dat\anaconda3\lib\site-packages (from wordcloud) (1.21.5)
Requirement already satisfied: pillow in c:\users\e-dat\anaconda3\lib\site-packages (from wordcloud) (9.2.0)
Requirement already satisfied: matplotlib in c:\users\e-dat\anaconda3\lib\site-packages (from wordcloud) (3.5.2)
Requirement already satisfied: packaging>=20.0 in c:\users\e-dat\anaconda3\lib\site-packages (from matplotlib->wordcloud) (21.3)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\e-dat\anaconda3\lib\site-packages (from matplotlib->wordcloud) (2.8.2)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\e-dat\anaconda3\lib\site-packages (from matplotlib->wordcloud) (1.4.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\e-dat\anaconda3\lib\site-packages (from matplotlib->wordcloud) (3.0.9)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\e-dat\anaconda3\lib\site-packages (from matplotlib->wordcloud) (4.25.0)
Requirement already satisfied: cycler>=0.10 in c:\users\e-dat\anaconda3\lib\site-packages (from matplotlib->wordcloud) (0.11.0)
Requirement already satisfied: six>=1.5 in c:\users\e-dat\anaconda3\lib\site-packages (from python-dateutil>=2.7->matplotlib->wordcloud) (1.16.0)
Note: you may need to restart the kernel to use updated packages.
from wordcloud import WordCloud
import matplotlib.pyplot as plt
# Define the text to be used in the wordcloud
text = "Text analytics is being used in business, particularly, in marketing, such as in customer relationship management. Coussement and Van den Poel (2008) apply it to improve predictive analytics models for customer churn (customer attrition). Text mining is also being applied in stock returns prediction."
# Generate the wordcloud
wordcloud = WordCloud(width=800, height=800, background_color='white', min_font_size=10).generate(text)
# Display the wordcloud
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
실행코드
파이썬 실행 코드 파일도 업로드해둡니다.
참고
다음의 웹사이트와 블로그도 참고하기 바랍니다. 다양한 워드클라우드 구현 사례들을 실행해 볼 수 있습니다.
A Wordcloud in Python
Last week I was at Pycon DE , the German Python conference. After hacking on scikit-learn a lot last week, I decided to to something differe...
peekaboo-vision.blogspot.com
Gallery of Examples — wordcloud 1.8.1 documentation
© Copyright 2020, Andreas Mueller
amueller.github.io
R 한글 텍스트 마이닝을 위한 KoNLP 설치 : Window 기준
R에서 한글 텍스트 마이닝 분석을 위한 KoNLP 설치 순서와 오류 해결 방법을 업데이트(2023년 9월 기준)하였습니다. 관심있는 분들은 다음 포스팅을 참고하기 바랍니다.
KoNLP 설치 순서 및 'scala-library-2.11.8.jar' 해결 방법 │R 4.3.1(Window 11 기준)
R에서 한글 텍스트 마이닝을 실행하기 위해서는 KoNLP 패키지를 설치해야 하고, 그 전에 JAVA도 설치해야 합니다. 다만, 설치 후, 'scala-library-2.11.8.jar' 오류로 형태소 분석이 실행되지 못하는 경우가
e-datanews.tistory.com
'교육' 카테고리의 다른 글
단어 빈도-역문서 빈도 분석(TF-IDF) 개념과 계산 방법│ChatGPT의 오류, 영혼 없는 사과 (0) | 2023.04.03 |
---|---|
ChatGPT API Key │ChatGPT R에서 사용하기 (0) | 2023.03.20 |
이미지 데이터 호출과 수정 │이미지 처리 │파이썬 python (0) | 2023.03.18 |
베이지크 국내 비건 스킨케어 일본 사용 후기 텍스트 마이닝 분석 사례│ 아마존 재팬 (0) | 2023.01.10 |
무료 코딩 없는 웹스크래핑 텍스트 마이닝 데이터 시각화│일본 유기농 립스틱 아마존 재팬 현지 고객 리뷰 사례 분석 (0) | 2023.01.09 |