Please answer following questions along with Python code andits result. Make sure to import NLTK.
Read in the texts of the State of the Unionaddresses, using the state_union corpus reader.Count occurrences of men, women, and people in eachdocument. What has happened to the usage of these words overtime?
Hint: use nltk.ConditionalFreqDist
from nltk.corpus import state_union
state_union.fileids()
# The first 4 digits stand for year.
[fileid[:4] for fileid in state_union.fileids()]
cfd = nltk.ConditionalFreqDist(
fill the rest – please deletethis line
Define a conditional frequency distribution over theNames Corpus that allows you to see which initiallettersare more frequent for males versus females (see Figure 2-7). (4points)
a. Show the code to
PayPal Gateway not configured
PayPal Gateway not configured