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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started