NPTEL Natural Language Processing Week 2 Assignment Answers 2024
Q1. According to Zipf’s law which statement(s) is/are correct?
(i) A small number of words occur with high frequency.
(ii) A large number of words occur with low frequency.
a. Both (i) and (ii) are correct
b. Only (ii) is correct
c. Only (i) is correct
d. Neither (i) nor (ii) is correct
Answer: a
Explanation: Zipf’s Law states that in natural language, few words occur very frequently while many words occur rarely.
Q2. Consider the following corpus C1 of 4 sentences. What is the total count of unique bi-grams for which the likelihood will be estimated? Assume we do not perform any pre-processing.
Sentences:
- today is Sneha’s birthday
- she likes ice cream
- she is also fond of cream cake
- we will celebrate her birthday with ice cream cake
a. 24
b. 28
c. 27
d. 23
Answer: a
Explanation: Each consecutive pair of words in a sentence forms a bi-gram. When duplicates are removed, the total number of unique bi-grams is 24.
Q3. A 3-gram model is a ___________ order Markov Model.
a. Two
b. Five
c. Four
d. Three
Answer: a
Explanation: A 3-gram model considers two previous words to predict the third. Hence, it is a 2nd-order Markov Model.
Q4. Which of these is/are valid Markov assumptions?
a. The probability of a word depends only on the current word.
b. The probability of a word depends only on the previous word.
c. The probability of a word depends only on the next word.
d. The probability of a word depends only on the current and the previous word.
Answer: a, c, d
Explanation: In simplified language models, the next word’s probability can be based on the current or prior word(s), depending on the Markov assumption used.
Q5. For the string ‘mash’, identify which of the following set of strings have a Levenshtein distance of 1.
a. smash, mas, lash, mushy, hash
b. bash, stash, lush, flash, dash
c. smash, mas, lash, mush, ash
d. None of the above
Answer: c
Explanation: Levenshtein distance measures the minimum number of edits. Only the words in option (c) are one edit away from “mash”.
Q6.
Answer: d
Q7.
Answer: a
Q8. Calculate P(they play in a big garden) assuming a bi-gram language model.
a. 1/8
b. 1/12
c. 1/24
d. None of the above
Answer: b
Explanation: Using a bi-gram model, each word is conditioned on the previous word. Based on the trained model, the combined probability is 1/12.
Q9. Considering the same model as in Question 7, calculate the perplexity of <s> they play in a big garden </s>
.
a. 2.289
b. 1.426
c. 1.574
d. 2.178
Answer: b
Explanation: Perplexity measures the inverse probability of the test set, normalized by the number of words. Based on the model’s likelihoods, it evaluates to 1.426.
Q10. Assume that you are using a bi-gram language model with add-one smoothing. Calculate P(they play in a beautiful garden).
a. 4.472 × 10⁻⁶
b. 2.236 × 10⁻⁶
c. 3.135 × 10⁻⁶
d. None of the above
Answer: b
Explanation: Add-one (Laplace) smoothing adjusts frequency counts to avoid zero probabilities. The computed smoothed probability for the sentence is 2.236 × 10⁻⁶.