WordCloud Based On Image

Creating wordcloud using different images

Himanshu Sharma
Analytics Vidhya

--

Wordcloud(Source: By Author)

Wordcloud is a visual representation of clusters of words with different sizes according to their times of occurrence in the dataset. The more a word appears larger will be its size in the word cloud. It helps in understanding the sentiments or the occurrence of particular words in a dataset.

Wordcloud is an open-source python library that is used to create wordclouds. In this article, we will be using different images for creating wordclouds on them and also explore different datasets and types of wordcloud.

Let’s get started…

Installing required libraries

We will start by installing the wordcloud using pip. The command given below will install it.

pip install wordcloud

Importing required libraries

In this step, we will import the required libraries and functions to create wordcloud.

import osfrom PIL import Image 
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import gaussian_gradient_magnitude
from wordcloud import WordCloud, ImageColorGenerator

Creating wordcloud image

--

--

Himanshu Sharma
Analytics Vidhya

I write about my learnings in the field of Data Science, Visualization, Artificial Intelligence, etc.| Linkedin: https://www.linkedin.com/in/himanshusharmads/