February 2018
Beginner to intermediate
364 pages
10h 32m
English
NLTK provides a class, ntlk.probabilities.FreqDist, that allow us to very easily calculate the frequency distribution of values in a list. Let's examine using this class (code is in 07/freq_dist.py):
from nltk.probabilities import FreqDistfrom nltk.tokenize import regexp_tokenizefrom nltk.corpus import stopwords
with open('wotw.txt', 'r') as file: data = file
Read now
Unlock full access