Question: In python use the file 100-0.txt which is the complete works of Shakespeare. By word we will refer to the elements of a list that
In python use the file 100-0.txt which is the complete works of Shakespeare. By word we will refer to the elements of a list that is produced by splitting the string containing the contents of the file on whitespace. You will need to remove punctuation and convert all words to lowercase.
(a) Determine the ten words which occur the most number of times. Store these in a list sorted according to frequency. (b) Create a dictionary which contains the frequencies for the bigrams in the file. A bigram is a pair of words which occur one after the other. Bigrams should occur within a sentence so you may need to first create a list of sentences.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
