0
0
NLPml~20 mins

Language modeling concept in NLP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Language Modeling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:00remaining
What does a language model predict?

In simple terms, what is the main task of a language model?

APredict the next word in a sentence based on previous words
BTranslate text from one language to another
CIdentify the topic of a given text
DSummarize a long paragraph into a short sentence
Attempts:
2 left
💡 Hint

Think about what comes next when you read a sentence.

Predict Output
intermediate
1:30remaining
Output of a simple bigram language model prediction

Given the following bigram probabilities, what is the predicted next word after 'I'?

{'I': {'am': 0.6, 'like': 0.3, 'have': 0.1}}
A'is'
B'like'
C'have'
D'am'
Attempts:
2 left
💡 Hint

Choose the word with the highest probability after 'I'.

Model Choice
advanced
2:00remaining
Choosing a model type for language modeling

You want to build a language model that understands long sentences and context. Which model type is best?

AN-gram model with n=2
BRecurrent Neural Network (RNN)
CBag-of-words model
DSimple linear regression
Attempts:
2 left
💡 Hint

Think about models that remember previous words in a sequence.

Hyperparameter
advanced
1:30remaining
Effect of increasing vocabulary size in language models

What is a likely effect of increasing the vocabulary size in a language model?

AModel requires more memory and training data
BModel training becomes faster and simpler
CModel accuracy always decreases
DModel ignores rare words automatically
Attempts:
2 left
💡 Hint

Think about what happens when the model has to learn more words.

Metrics
expert
2:00remaining
Interpreting perplexity in language models

A language model has a perplexity score of 20 on a test set. What does this mean?

AThe model is 20 times better than random guessing
BThe model makes 20% errors in predictions
COn average, the model is as uncertain as choosing among 20 options
DThe model predicts the next word with 20% probability
Attempts:
2 left
💡 Hint

Perplexity measures how surprised the model is by the test data.