Natural Language Processing Sentiment Analysis and Text Classification 1 — Questions and Answers
Question 1: What is sentiment analysis in NLP?
- The task of determining the emotional tone or opinion expressed in a piece of text (Correct answer)
- The task of summarizing a document into key points
- The process of identifying grammatical errors in text
- A method for extracting named entities from reviews
Correct answer: The task of determining the emotional tone or opinion expressed in a piece of text
Sentiment analysis classifies text as positive, negative, or neutral (and sometimes finer-grained emotions), enabling automated opinion mining from reviews, tweets, etc.
Question 2: What is aspect-based sentiment analysis (ABSA)?
- Identifying sentiment expressed toward specific aspects or features of an entity, rather than overall sentiment (Correct answer)
- Analyzing the grammatical aspects of a sentence
- Classifying text into topics using unsupervised clustering
- Detecting irony and sarcasm in customer feedback
Correct answer: Identifying sentiment expressed toward specific aspects or features of an entity, rather than overall sentiment
ABSA extracts aspects (e.g., 'battery life', 'screen') from product reviews and assigns a sentiment polarity to each aspect independently.
Question 3: What is the main challenge of detecting sarcasm in sentiment analysis?
- Sarcasm uses positive language to convey negative sentiment, contradicting surface-level lexical signals (Correct answer)
- Sarcastic text contains more grammatical errors
- Sarcasm only appears in spoken language, not text
- Sarcastic sentences are always shorter than sincere ones
Correct answer: Sarcasm uses positive language to convey negative sentiment, contradicting surface-level lexical signals
Sarcasm creates a mismatch between the literal meaning of words and the intended sentiment, making lexicon-based approaches unreliable.
Question 4: What is the Naive Bayes classifier commonly used for in NLP?
- Text classification tasks such as spam detection and sentiment analysis based on word frequency features (Correct answer)
- Generating text sequences token by token
- Parsing the syntactic structure of a sentence
- Aligning source and target words in machine translation
Correct answer: Text classification tasks such as spam detection and sentiment analysis based on word frequency features
Naive Bayes applies Bayes' theorem with a conditional independence assumption between features, making it a fast and effective baseline for text classification.
Question 5: What does a confusion matrix reveal about a text classifier?
- The counts of true positives, true negatives, false positives, and false negatives for each class (Correct answer)
- The distribution of word frequencies in the training corpus
- The learning curve of the model during training
- The vocabulary size required for the classification task
Correct answer: The counts of true positives, true negatives, false positives, and false negatives for each class
A confusion matrix shows how often the model predicted each class correctly or confused it with another class, enabling diagnosis of specific error types.
Question 6: What is the difference between binary and multi-class text classification?
- Binary classification assigns text to one of two classes, while multi-class assigns it to one of three or more classes (Correct answer)
- Binary classification uses neural networks while multi-class uses rules
- Multi-class classification always requires more training data than binary
- Binary classification cannot be applied to sentiment analysis
Correct answer: Binary classification assigns text to one of two classes, while multi-class assigns it to one of three or more classes
Binary classification has two output classes (e.g., spam/not spam), while multi-class classification handles three or more mutually exclusive categories.
What is sentiment analysis in NLP?