VANAUDEL ANALYTIX
Follow Us
  • Home
  • About
  • Python Blog
  • SAS Blog
  • Open Data Science
  • Consulting
  • Contact

Creating Word clouds in python

8/24/2019

1 Comment

 
Given a particular text or string, it is possible to create an image containing the words of that text, where the size of each word is dependent on its frequency within the text. Such an image is referred to as a Word Cloud. Using Python's wordcloud and matplotlib libraries, a Data Scientist can easily generate a word cloud given an input string or text.

The following is a Word Cloud generated for The Mother Goose poem called "Hey, diddle, diddle".
Picture
Uses of a Word Cloud:

​Word Clouds make great visualization tools. They provide a quick picture of which words are most and least frequently used in a text or document. That kind of information can influence the actions of writers, bloggers and companies who receive feedback and comments from clients by highlighting important (frequently occurring) words. Keep in mind that a little bit of text preprocessing before the generation of a Word Cloud makes a huge difference. 

Python code needed for generating Word Clouds:

Import Libraries and Set System Options
​
Picture

​Define Functions
​
Picture

Generate Word Cloud for the Mother Goose poem "Humpty Dumpty sat on a wall"
​
Picture
Picture

​Generate Word Cloud for the Mother Goose poem "How much wood could a woodchuck chuck ..."
​
Picture
Picture
Generate Word Cloud for the Mother Goose poem "Jack be nimble"
Picture
Picture
Conclusion:

Words Clouds are colorful and informative and give a quick visual of the most and least frequently occurring words in a text or document.

Happy Learning!
1 Comment
Bisexual Escorts Tulsa link
4/9/2025 10:26:44 am

I find word clouds to be an engaging way to visualize text data.

Reply



Leave a Reply.

    Author

    My name is Vanessa Afolabi also known as @TheSASMom. I am a Data Scientist fluent in SAS, R, Python and SQL with a passion for Machine Learning and Research.

    Archives

    September 2019
    August 2019
    January 2019

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.