Professional Documents
Culture Documents
Filtering Words
Filtering Words
Filtering Words
Now let's see one more example which filters words having the prefix Sun.
The above example is case-sensitive. It doesn't filter the words starting with
lowercase s and followed by un.
Frequency Distribution
FreqDist functionality of nltk can be used to determine the frequency of all
words, present in an input text.
The following example, determines frequency distribution of text1 and further
displays the frequency of word Sunday.
Frequency Distribution
Now let's identify three frequent words from text1_freq distribution
using most_common method.
The output says the three most frequent words are , , the, and .
It may be weird for few of you