The word cloud package provides easy to use functions to build a word cloud. Build a simple word cloud using this package.
- [Narrator] In this video we will display the word cloud based on the data frame created in the previous video. In order to create this word cloud we will use the wordcloud package. Please install the same if it is not available in your environment. I will now go ahead and install the package now. Next I will load the wordcloud library. We start off with a simple word cloud using the wordcloud function. We will specify the list of words to be displayed and their corresponding frequencies. Let's execute the code now and view the word cloud. We notice that only six words are displayed. This is because, by default, the output only shows words with a frequency of three or more. We can control the number of words being displayed by using two other parameters. We will use the max.words to control the total number of words displayed. Then, we use min.freq to control the minimum frequency required for a word to be displayed. We choose a minimum frequency of one, and the maximum number of words to be 10. Let's execute and see the results. Now you will see more number of words displayed, and the maximum number of words is limited to 10. In the next video, we will enhance this word cloud even further.
- Creating a word cloud
- Analyzing sentiment
- Extracting emotions from text
- Clustering similar entities based on text
- Using classification for supervised learning
- Recommending items to users based on text data analytics