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
Get step-by-step solutions from verified subject matter experts
