DSE Natural Language Processing Fundamentals 3 โ Questions and Answers
Question 1: What is the primary difference between stemming and lemmatization?
- Stemming uses a dictionary while lemmatization uses rules
- Stemming applies heuristic rules while lemmatization returns valid base dictionary forms (Correct answer)
- Stemming is more accurate than lemmatization
- Lemmatization removes suffixes while stemming adds prefixes
Correct answer: Stemming applies heuristic rules while lemmatization returns valid base dictionary forms
Stemming uses rule-based chopping of word endings, while lemmatization uses morphological analysis to return proper base forms.
Question 2: In sentiment analysis, what is the challenge of handling negation in sentences like 'not good'?
- Negation is always removed during stopword filtering
- Bag-of-words models miss the interaction between 'not' and 'good' (Correct answer)
- Neural models cannot process negation at all
- Negation only affects named entities
Correct answer: Bag-of-words models miss the interaction between 'not' and 'good'
Simple bag-of-words models treat words independently, so 'not' and 'good' are scored separately rather than as an inverted sentiment unit.
Question 3: Which technique allows a pre-trained language model to perform a new NLP task with only a few examples provided in the input prompt?
- Transfer learning
- Few-shot prompting (Correct answer)
- Data augmentation
- Curriculum learning
Correct answer: Few-shot prompting
Few-shot prompting provides the model with a small number of input-output examples in the prompt, enabling task performance without gradient updates.
Question 4: What does TF-IDF measure in document representation?
- The semantic similarity between two documents
- The importance of a term in a document relative to a corpus (Correct answer)
- The probability of a word appearing next in a sequence
- The frequency of named entities in a text
Correct answer: The importance of a term in a document relative to a corpus
TF-IDF weights terms by how often they appear in a document (TF) discounted by how common they are across all documents (IDF).
Question 5: In dependency parsing, what does a dependency arc represent?
- A co-reference link between two noun phrases
- A directed grammatical relationship between a head word and a dependent word (Correct answer)
- A semantic role assigned to a verb argument
- A phrase boundary between two constituents
Correct answer: A directed grammatical relationship between a head word and a dependent word
Dependency arcs connect a head word to its grammatical dependent, labeled with the type of syntactic relation (e.g., subject, object).
Question 6: Which training objective does BERT use during pre-training?
- Next sentence prediction only
- Masked language modeling and next sentence prediction (Correct answer)
- Autoregressive language modeling
- Contrastive learning with negative sampling
Correct answer: Masked language modeling and next sentence prediction
BERT is pre-trained using Masked Language Modeling (MLM) and Next Sentence Prediction (NSP) jointly.
Question 7: What is the role of the key, query, and value matrices in scaled dot-product attention?
- They encode positional information for each token
- They project inputs to compute attention scores and weighted value outputs (Correct answer)
- They store the vocabulary embeddings for lookup
- They apply layer normalization before softmax
Correct answer: They project inputs to compute attention scores and weighted value outputs
Queries and keys are compared via dot product to produce attention weights, which then blend value vectors into the output.
What is the primary difference between stemming and lemmatization?