QUIZ
NLP basics
12 questions on NLP basics, from 14 lessons. Pick an answer in your head, then open it.
On the roadmap for: AI Engineering, Data Science.
Question 1 of 12
Why can removing stop words hurt a sentiment model?
- A. It doesn't: stop words never affect sentiment
- B. Stop words carry most of the sentiment in a review
- C. Stop-word lists include 'not', which flips the meaning
- D. It makes each review longer and noisier, so it's harder to classify
View answer
✓ C. Stop-word lists include 'not', which flips the meaning
'Not good' becomes 'good'. Preprocessing choices should be tested against the task.
Lesson: Text Preprocessing
Question 2 of 12
What does TF-IDF do that raw word counts don't?
- A. It uses the order of words in each document
- B. It down-weights words found in many documents
- C. It removes all common words from the text
- D. It learns a dense embedding for each word in a vocabulary
View answer
✓ B. It down-weights words found in many documents
A word like 'the' appears everywhere and gets a low IDF; a rare, specific word gets a high one.
Lesson: Bag-of-Words, N-grams and TF-IDF
Question 3 of 12
Why does a unigram model misread 'not good', and what fixes it?
- A. It can't read short text; use longer reviews
- B. It sees 'not' and 'good' apart; bigrams join them
- C. It ignores adjectives, so 'good' is always dropped
- D. It needs stemming to match 'good' and 'goods'
View answer
✓ B. It sees 'not' and 'good' apart; bigrams join them
Bigrams keep local word order that changes meaning.
Lesson: Text Classification: Naive Bayes vs Logistic Regression
Question 4 of 12
What assumption does Naive Bayes make about words?
- A. All words are equally likely to appear in every class
- B. Words appear in a fixed order
- C. Only nouns carry information about the class
- D. Words are independent of each other given the class
View answer
✓ D. Words are independent of each other given the class
The assumption is wrong for language but makes the model fast and surprisingly strong on small data.
Lesson: Text Classification: Naive Bayes vs Logistic Regression
Question 5 of 12
How does LDA describe a collection of documents?
- A. Documents form a tree from general to specific topics
- B. Documents mix topics; topics are word distributions
- C. Each document gets exactly one topic label
- D. Each document becomes a short list of keywords
View answer
✓ B. Documents mix topics; topics are word distributions
It is unsupervised: you choose the number of topics, and it finds the word groups.
Question 6 of 12
What does perplexity measure for a language model?
- A. The size of its vocabulary
- B. How surprised it is by test text, per token
- C. How fast it generates tokens on standard hardware
- D. The number of parameters in the model
View answer
✓ B. How surprised it is by test text, per token
Lower is better. Perplexity k is like choosing uniformly among k tokens at each step.
Question 7 of 12
How is the edit (Levenshtein) distance between two words computed?
- A. By comparing only the first and last letters
- B. By counting the letters the two words share
- C. By the cosine distance between the two words' embedding vectors
- D. Fewest inserts, deletes and swaps, via dynamic programming
View answer
✓ D. Fewest inserts, deletes and swaps, via dynamic programming
A table builds up the distance between every pair of prefixes.
Question 8 of 12
How does an LLM handle a word it has never seen?
- A. It always replaces the word with a single [UNK] token
- B. It skips the word and carries on
- C. It stops generating with an error
- D. Subword tokenisation splits it into known pieces
View answer
✓ D. Subword tokenisation splits it into known pieces
BPE builds a vocabulary by merging frequent character pairs, so any word can be spelled with subwords.
Lesson: Subword Tokenisation (BPE, WordPiece, SentencePiece)
Question 9 of 12
Why is named entity recognition scored with entity-level F1 rather than per-token accuracy?
- A. It's faster to compute on large datasets with many sentences
- B. Most tokens aren't entities; half-right spans are wrong
- C. Accuracy can't be computed for sequences at all
- D. Tokens in NER datasets don't have labels
View answer
✓ B. Most tokens aren't entities; half-right spans are wrong
Token accuracy looks high just by predicting 'O' (outside) everywhere.
Lesson: Sequence Labelling and NER
Question 10 of 12
What does the Viterbi algorithm find?
- A. The single most likely label sequence for the sentence
- B. The edit distance between two misspelt words
- C. The most common word in the whole sentence
- D. The main topic of the document that the sentence came from
View answer
✓ A. The single most likely label sequence for the sentence
It's used in HMMs and CRFs to label every word at once rather than one at a time.
Question 11 of 12
How is BERT pretrained?
- A. By classifying whole documents
- B. By translating sentences between languages
- C. By predicting masked tokens from both sides
- D. By predicting the next word, left to right
View answer
✓ C. By predicting masked tokens from both sides
Masked language modelling gives bidirectional representations that adapt well to classification and tagging.
Lesson: BERT and Masked Language Models
Question 12 of 12
Why can BLEU score a word salad above a correct paraphrase?
- A. It can't: BLEU always ranks paraphrases higher
- B. BLEU checks meaning, but word salads fool its checks
- C. It counts n-gram overlap, so matching words can win
- D. BLEU always prefers the shorter of two candidates
View answer
✓ C. It counts n-gram overlap, so matching words can win
Overlap metrics don't understand meaning; use them with care or alongside human or model-based judgements.