Question: Python In this problem you will use the file 100-0.txt which is the complete works of Shakespeare. Carry out the steps below. By word we

Python

In this problem you will use the file 100-0.txt which is the complete works of Shakespeare. Carry out the steps below. 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. Store your answers in the appropriate variables.

(a) Using tuples as the keys and 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. You can assume that splitting on . will accomplish this although that is unlikely to be the case as . can appear in different contexts. bigrams are word pairs so {comes comes} and {comes one} are both bigrams

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!