{ "lesson": "05-sentiment-analysis", "title": "Sentiment Analysis", "questions": [ { "stage": "pre", "question": "Why is 'The food was not great' a hard case for naive BoW classifiers?", "options": [ "It has no punctuation", "It mixes English and French", "It contains too few tokens", "Negation flips meaning, but bag of words discards the link between 'not' and 'great'" ], "correct": 3, "explanation": "BoW cannot bind 'not' to the word it negates, so the classifier misses the polarity flip." }, { "stage": "pre", "question": "What two steps make up classical sentiment analysis?", "options": [ "Translate, then classify", "Represent (vectorize text) and classify (linear model on the vector)", "Search, then rank", "Embed, then cluster" ], "correct": 1, "explanation": "Classical sentiment is feature extraction followed by a linear classifier." }, { "stage": "check", "question": "Why does Naive Bayes work despite its 'naive' independence assumption?", "options": [ "Laplace smoothing fixes dependence", "The assumption is actually true for text", "Naive Bayes secretly learns interactions", "With sparse text features and moderate data the classifier mostly cares which side each word leans toward, not exact joint probabilities" ], "correct": 3, "explanation": "Even with wrong independence, leaning-direction information per word is enough to classify well." }, { "stage": "check", "question": "Why include 'NOT_' prefixed tokens during preprocessing?", "options": [ "To stem the words", "To shrink the vocabulary", "To normalize case", "To turn 'good' versus 'NOT_good' into separate features that the classifier can weight oppositely" ], "correct": 3, "explanation": "Negation scoping splits negated forms into distinct features so a BoW classifier can model the flip." }, { "stage": "check", "question": "Why is removing stopwords risky for sentiment analysis?", "options": [ "Stopword removal breaks tokenization", "It increases sparsity", "Stopword lists are too long", "Negation words ('not', 'no', 'never') are usually treated as stopwords but carry sentiment signal" ], "correct": 3, "explanation": "Default stopword lists drop negations and similar carriers of sentiment." }, { "stage": "post", "question": "Which metric should you report when sentiment classes are imbalanced?", "options": [ "Accuracy alone", "Macro-F1 (mean of per-class F1s, equal-weighted)", "Mean squared error", "Micro-F1 only" ], "correct": 1, "explanation": "Macro-F1 forces the minority class to count; accuracy or micro-F1 hides it." }, { "stage": "post", "question": "When should you skip classical models and reach for a transformer for sentiment?", "options": [ "When you have under 100 examples", "Sarcasm detection, long shifting documents, aspect-based sentiment, or low-resource languages", "When latency is critical", "When you need explainability" ], "correct": 1, "explanation": "Sarcasm, aspect-based, and cross-lingual sentiment exceed classical BoW models' reach." }, { "stage": "post", "question": "Why is L2 regularization important for logistic regression on text?", "options": [ "Speeds up matrix inversion", "Avoids ReLU dead units", "Sparse high-dimensional text features otherwise let the model memorize training examples", "Required to compute gradients" ], "correct": 2, "explanation": "L2 prevents overfitting in the sparse-feature, high-dimensional regime of text." } ] }