Natural Language Processing Natural Language Processing MCQ 2 — Questions and Answers
Question 1: Which algorithm is used in the Viterbi decoding process for Hidden Markov Models in NLP?
- Bellman-Ford shortest path
- Dynamic programming (Correct answer)
- Greedy search
- Branch and bound
Correct answer: Dynamic programming
Viterbi decoding uses dynamic programming to efficiently find the most probable sequence of hidden states in an HMM.
Question 2: What does the BLEU score measure in NLP?
- Named entity recognition accuracy
- Machine translation quality (Correct answer)
- Sentiment classification precision
- Parsing tree depth
Correct answer: Machine translation quality
BLEU (Bilingual Evaluation Understudy) measures machine translation quality by comparing n-gram overlaps with reference translations.
Question 3: In the context of word embeddings, what is the primary advantage of FastText over Word2Vec?
- Faster training speed on GPUs
- Handles out-of-vocabulary words using subword information (Correct answer)
- Produces higher-dimensional vectors
- Uses bidirectional context windows
Correct answer: Handles out-of-vocabulary words using subword information
FastText decomposes words into character n-grams, allowing it to generate embeddings for words not seen during training.
Question 4: What is the main purpose of the CRF (Conditional Random Field) layer commonly added on top of BERT for sequence labeling tasks?
- To reduce the dimensionality of token representations
- To model dependencies between consecutive output labels (Correct answer)
- To apply dropout regularization during inference
- To convert subword tokens back to word-level predictions
Correct answer: To model dependencies between consecutive output labels
CRF models global label sequence dependencies, ensuring predictions like B-I-O tagging constraints are respected across tokens.
Question 5: Which technique is used in BPE (Byte Pair Encoding) tokenization?
- Splitting text on whitespace and punctuation only
- Iteratively merging the most frequent character pairs into subword units (Correct answer)
- Assigning tokens based on morphological root extraction
- Mapping each word to a fixed-length hash index
Correct answer: Iteratively merging the most frequent character pairs into subword units
BPE starts with characters and repeatedly merges the most frequent adjacent pair until a target vocabulary size is reached.
Question 6: In transformer models, what does 'positional encoding' address?
- The lack of recurrence means the model has no inherent sense of token order (Correct answer)
- Normalizing embedding magnitudes across different sequence lengths
- Encoding part-of-speech tags into token representations
- Handling padding tokens during batch processing
Correct answer: The lack of recurrence means the model has no inherent sense of token order
Unlike RNNs, transformers process all tokens simultaneously, so positional encodings inject order information into embeddings.
Question 7: What is 'coreference resolution' in NLP?
- Resolving ambiguous word senses using surrounding context
- Identifying all expressions in a text that refer to the same real-world entity (Correct answer)
- Matching question-answer pairs in information retrieval
- Detecting paraphrase relationships between sentence pairs
Correct answer: Identifying all expressions in a text that refer to the same real-world entity
Coreference resolution links mentions like pronouns and noun phrases that refer to the same entity within a document.
Which algorithm is used in the Viterbi decoding process for Hidden Markov Models in NLP?