Question: Please answer following questions along with Python code and its result. Make sure to import NLTK. Read in the texts of the State of the

Please answer following questions along with Python code and its result. Make sure to import NLTK.

Read in the texts of the State of the Union addresses, using the state_union corpus reader. Count occurrences of men, women, and people in each document. What has happened to the usage of these words over time?

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 delete this line

Define a conditional frequency distribution over the Names Corpus that allows you to see which initialletters are more frequent for males versus females (see Figure 2-7). (4 points)

a. Show the code to get the cfd

b. Draw plot and tell which (capital) letter starts with males names mostly from the plot.

c. List males name which starts with the letter from b.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!