Question 1Easy
What is tokenization in NLP?
- Translating text into another language
- Assigning a positive or negative sentiment label to each piece of text
- Splitting text into smaller units such as words or subwords
- Removing all punctuation from text
Answer: C. Splitting text into smaller units such as words or subwords
Explanation
Tokens are the basic units models operate on; e.g. "I love NLP" -> ["I", "love", "NLP"].
Step-by-step solution
- Models cannot read raw strings directly.
- Tokenization splits text into units (words, subwords or characters).
- Each token is then mapped to an ID and later to a vector.
Why the other options are wrong
- A. Translation is a full task, not preprocessing.
- B. Sentiment labelling is classification.
- D. Removing punctuation is a cleaning step; tokenization may keep punctuation as tokens.
Question 2Easy
Why are stop words (like "the", "is", "and") often removed in classic NLP pipelines?
- Models cannot process them, because they are not in any vocabulary
- They are frequent but carry little topical meaning
- They increase the vocabulary diversity
- They are always spelling mistakes
Answer: B. They are frequent but carry little topical meaning
Explanation
Removing them shrinks bag-of-words features. Note that for some tasks (e.g. negation in sentiment) they can matter.
Step-by-step solution
- Stop words appear in almost every document.
- They add little information about the topic.
- Removing them shrinks data and noise for bag-of-words models.
Why the other options are wrong
- A. Models can process stop words; they are just low-value for topic.
- C. They reduce information density, not increase diversity.
- D. They are ordinary words, not misspellings.
Question 3Medium
What is the difference between stemming and lemmatization?
- They are identical; both always return a valid dictionary word for every input
- Stemming chops suffixes by rules; lemmatization finds the dictionary form
- Lemmatization is always faster than stemming
- Stemming uses a dictionary while lemmatization uses rules only
Answer: B. Stemming chops suffixes by rules; lemmatization finds the dictionary form
Explanation
"studies" may be stemmed to "studi" but lemmatized to "study"; "better" can be lemmatized to "good".
Step-by-step solution
- Stemming cuts endings with rules: 'studies' -> 'studi'.
- Lemmatization uses vocabulary and grammar to return the dictionary form: 'studies' -> 'study'.
- Lemmatization is more accurate; stemming is faster.
Why the other options are wrong
- A. Stems are often not real words, so they are not identical.
- C. Lemmatization needs dictionary lookups, so it is usually slower.
- D. This reverses the two.
Question 4Medium
What advantage do word embeddings (e.g. Word2Vec) have over one-hot encoding?
- Vector size equals vocabulary size
- Each word gets a unique, orthogonal vector
- They need no training because each word's vector is assigned at random and kept
- Dense vectors in which similar words lie close together
Answer: D. Dense vectors in which similar words lie close together
Explanation
One-hot vectors are sparse, as long as the vocabulary, and all equally distant. Embeddings capture semantic similarity.
Step-by-step solution
- One-hot vectors are as long as the vocabulary and all equally far apart.
- Embeddings are short dense vectors learned from context.
- Words used in similar contexts get similar vectors.
Why the other options are wrong
- A. Vocabulary-sized vectors describe one-hot encoding.
- B. Unique orthogonal vectors are one-hot; they capture no similarity.
- C. Embeddings are learned, not fixed random vectors.
Question 5Hard
A word appears 3 times in a 100-word document and in 10 of 1,000 documents in the corpus. Using TF = count / length and IDF = log10(N / df), what is its TF-IDF score?
- 0.3
- 0.03
- 0.06
- 2
Answer: C. 0.06
Explanation
TF =
3 / 100 = 0.03.
IDF = log10(1000 / 10) =
log10 100 = 2.
TF-IDF =
0.03 x 2 = 0.06.
Step-by-step solution
- TF =
3 / 100 = 0.03.
- IDF = log10(1000 / 10) =
log10(100) = 2.
- TF-IDF =
0.03 x 2 = 0.06.
Why the other options are wrong
- A. 0.3 misplaces the decimal in TF.
- B. 0.03 is TF alone, without IDF.
- D. 2 is IDF alone.
Tip: TF-IDF = how often here x how rare elsewhere.