NATURAL LANGUAGE PROCESSING · INTERVIEW QUESTION
Compare stemming and lemmatization.
🟢 beginner · NLP
Hint: Focus on the decision rule, assumptions, and failure mode behind nlp.
Answer
Stemming applies crude suffix rules and may produce non-words. Lemmatization uses vocabulary and morphology to return canonical dictionary forms.
Interview reasoning
Stemming applies surface rules and may return nonwords; lemmatization uses linguistic analysis to recover a lemma. For example, went can map to go only with lexical knowledge.
Stemming applies heuristic word reductions; lemmatization uses lexical and sometimes grammatical analysis. Their value depends on retrieval or classification objectives and the language. Stop-word removal is another task-dependent choice: some frequent words encode negation, relationships or exact query meaning and should remain available.
Worked example. 'Running' and 'ran' can map to lemma 'run', while a stemmer may return mechanically truncated forms.
Validation
Compare retrieval recall and precision on inflected and ambiguous terms.
Compare transformed and original text on exact entities, negation and morphology; evaluate with the intended lexical or pretrained-model pipeline.
Common pitfalls
Aggressive reduction can merge terms whose distinctions matter to the task.
A transformation useful for bag-of-words search may harm a pretrained contextual encoder or an extraction task needing original offsets.
Likely follow-up: Compare retrieval recall and precision on inflected and ambiguous terms.