Challenge - 5 Problems
OOV Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What is the main purpose of using an UNK token in NLP models?
In natural language processing, when a word is not found in the model's vocabulary, an UNK token is often used. What is the main purpose of this token?
Attempts:
2 left
💡 Hint
Think about how the model deals with words it has never seen before.
✗ Incorrect
The UNK token acts as a catch-all for any word not in the vocabulary, allowing the model to process inputs without crashing or ignoring unknown words.
❓ Predict Output
intermediate1:30remaining
What is the output of this tokenization with OOV handling?
Given the vocabulary {'hello': 1, 'world': 2} and the sentence 'hello there world', what is the tokenized output using 0 as the UNK token index?
NLP
vocab = {'hello': 1, 'world': 2}
sentence = 'hello there world'
tokens = [vocab.get(word, 0) for word in sentence.split()]
print(tokens)Attempts:
2 left
💡 Hint
Words not in the vocabulary get the UNK token index 0.
✗ Incorrect
The word 'there' is not in the vocabulary, so it is replaced by 0. 'hello' maps to 1 and 'world' maps to 2.
❓ Model Choice
advanced2:00remaining
Which model architecture is best suited to handle out-of-vocabulary words using subword units?
You want to build an NLP model that can handle out-of-vocabulary words effectively by breaking words into smaller parts. Which model architecture or technique is best for this?
Attempts:
2 left
💡 Hint
Think about how breaking words into smaller parts helps with unknown words.
✗ Incorrect
Subword tokenization methods like BPE or WordPiece split rare or unknown words into known smaller units, allowing the model to understand and generate words it has never seen before.
❓ Hyperparameter
advanced1:30remaining
Which hyperparameter affects the size of the vocabulary and thus the handling of OOV words in subword tokenization?
When using Byte Pair Encoding (BPE) for tokenization, which hyperparameter directly controls the vocabulary size and impacts how many out-of-vocabulary words appear?
Attempts:
2 left
💡 Hint
Think about what controls how many subword units are created.
✗ Incorrect
The number of merge operations in BPE determines how many subword units are merged, controlling vocabulary size and granularity. More merges mean larger vocabulary and fewer OOV tokens.
❓ Metrics
expert2:00remaining
How does the presence of many out-of-vocabulary words affect the model's perplexity on a test set?
You evaluate a language model on a test set containing many out-of-vocabulary (OOV) words. How does this typically affect the model's perplexity metric?
Attempts:
2 left
💡 Hint
Think about how unknown words affect prediction confidence.
✗ Incorrect
When many OOV words appear, the model cannot predict them well, leading to higher uncertainty and thus higher perplexity values, which means worse model performance.