NLP Basics Questions with Answers

5 practice questions on NLP Basics (AI & Machine Learning) with answers and step-by-step solutions. Try 5 samples below, then practise all 5 free in the AptiNest app.

Sample questions

Question 1Easy

What is tokenization in NLP?

  1. Translating text into another language
  2. Assigning a positive or negative sentiment label to each piece of text
  3. Splitting text into smaller units such as words or subwords
  4. 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

  1. Models cannot read raw strings directly.
  2. Tokenization splits text into units (words, subwords or characters).
  3. 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?

  1. Models cannot process them, because they are not in any vocabulary
  2. They are frequent but carry little topical meaning
  3. They increase the vocabulary diversity
  4. 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

  1. Stop words appear in almost every document.
  2. They add little information about the topic.
  3. 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?

  1. They are identical; both always return a valid dictionary word for every input
  2. Stemming chops suffixes by rules; lemmatization finds the dictionary form
  3. Lemmatization is always faster than stemming
  4. 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

  1. Stemming cuts endings with rules: 'studies' -> 'studi'.
  2. Lemmatization uses vocabulary and grammar to return the dictionary form: 'studies' -> 'study'.
  3. 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?

  1. Vector size equals vocabulary size
  2. Each word gets a unique, orthogonal vector
  3. They need no training because each word's vector is assigned at random and kept
  4. 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

  1. One-hot vectors are as long as the vocabulary and all equally far apart.
  2. Embeddings are short dense vectors learned from context.
  3. 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?

  1. 0.3
  2. 0.03
  3. 0.06
  4. 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

  1. TF = 3 / 100 = 0.03.
  2. IDF = log10(1000 / 10) = log10(100) = 2.
  3. 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.

Practise all 5 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all AI & Machine Learning topics · All topics