From the course: Build Three Real-World Python Applications

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

How to analyze word frequency

How to analyze word frequency

- [Instructor] Word clouds are a fun way to visually see what words are popular in a set of text data. But it could be difficult to see what words there are and exactly how frequently they occur in our novel. This is where word frequency analysis is useful. With word frequency analysis, We can create a word frequency distribution to see what words occur in the text and how frequently they show up. We will begin doing this by creating our fdist variable for our frequency distribution, and equal it to the nltk package and use the FreqDist function. And we want to look at our tokens variable. Remember, this tokens variable is what we made earlier in our data cleaning section, where we split the text step by word, got rid of the stop words, and kept only the words that were three letters or longer. If we go down the line and type in our fdist variable, we can then print it out and see what our output is. When you run this…

Contents