Question: * In python Input: A word Output : List of words that can follow the input word, and their corresponding probabilities Steps to follow: 1)

* In python

Input: A word

Output : List of words that can follow the input word, and their corresponding probabilities

Steps to follow:

1) Build the bigram LM:

1.A) Use nltk to compile all the unique bigrams from the corpus you used for the previous assignment.

1.B) Compute probability of each bigram using MLE ( count(w1 w2) / count(w1) )

2) Next word prediction using the above bigram LM:

2.A) Get an input word from user, inpW.

2.B) Use the above bigram LM to find all the bigrams where the input word, inpW, is w1. Display all possible next words from these bigrams and their corresponding probabilities.

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!