Unit 4: Natural Language Processing with Classification Models - Practice Quiz

INT344 — Natural Language Processing 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 In the context of sentiment analysis using Logistic Regression, what is the primary purpose of feature extraction?

A. To increase the length of the sentences
B. To transform raw text into numerical representations like vectors
C. To translate text from one language to another
D. To convert numerical vectors back into text

2 Which function is used in Logistic Regression to map the output to a probability value between 0 and 1?

A. Linear Function
B. ReLU Function
C. Sigmoid Function
D. Tangent Function

3 When extracting features for sentiment analysis, what does a frequency dictionary typically map?

A. Word length to Sentence length
B. (Word, Sentiment Label) pairs to the count of occurrences
C. Process ID to Memory usage
D. Each word to its synonym

4 In a binary logistic regression classifier for sentiment analysis, if the sigmoid output h(x) >= 0.5, how is the sentiment classified?

A. Neutral
B. Negative
C. Undefined
D. Positive

5 What is the formula for the sigmoid function, σ(z)?

A. 1 / (1 - e^-z)
B. log(z)
C. e^z / (1 + e^z)
D. 1 / (1 + e^-z)

6 In the feature vector representation X = [1, sum_pos, sum_neg], what does the '1' usually represent?

A. The count of the first word
B. The bias unit (intercept term)
C. The classification threshold
D. The learning rate

7 Which preprocessing step is commonly performed before feature extraction to reduce the vocabulary size without losing semantic meaning?

A. Duplicating sentences
B. Stemming and removing stop words
C. Capitalizing all letters
D. Removing all vowels

8 What is the 'Cost Function' used in Logistic Regression generally called?

A. Hinge Loss
B. Absolute Error
C. Cross-Entropy Loss (Log Loss)
D. Mean Squared Error

9 What is the goal of Gradient Descent in training a Logistic Regression model?

A. To set all weights to zero
B. To remove the bias term
C. To maximize the cost function
D. To minimize the cost function by iteratively updating weights

10 In Bayes' Rule, what does P(A|B) represent?

A. The posterior probability of A given B
B. The prior probability of A
C. The joint probability of A and B
D. The probability of B given A

11 Why is the Naive Bayes classifier called 'Naive'?

A. It was developed by a naive mathematician
B. It requires very little training data
C. It cannot handle complex text
D. It assumes that features are independent of each other given the class

12 What is the formula for Bayes' Theorem?

A. P(A|B) = P(B|A) + P(A)
B. P(A|B) = P(A) / P(B)
C. P(A|B) = P(B|A) * P(A) / P(B)
D. P(A|B) = P(A) * P(B)

13 In Naive Bayes Sentiment Analysis, what is 'Laplacian Smoothing' used for?

A. To average the sentiment scores
B. To smooth the decision boundary
C. To remove stop words
D. To handle words with zero probability (words not seen in training)

14 If a word appears in the positive corpus but not the negative corpus, what happens to its probability P(W|Negative) without smoothing?

A. It becomes infinity
B. It becomes 0
C. It becomes 1
D. It becomes 0.5

15 In Logistic Regression, if the dot product θ^T * x is 0, what is the output of the sigmoid function?

A. 1
B. undefined
C. 0.5
D. 0

16 Which of the following describes the 'Prior Probability' P(Positive) in Naive Bayes?

A. Probability of a word being positive
B. Probability of a document being positive given a specific word
C. Total number of words in the dictionary
D. Probability of a document being positive based on the training set distribution

17 Why do we typically use Log Likelihood in Naive Bayes calculations instead of raw probabilities?

A. To convert negative numbers to positive
B. Because logarithms are faster to compute than addition
C. To make the calculation harder
D. To prevent numerical underflow from multiplying many small probabilities

18 In the Naive Bayes inference formula, if the sum of the Log Prior and Log Likelihoods is greater than 0, the sentiment is classified as:

A. Ambiguous
B. Negative
C. Neutral
D. Positive

19 What is a 'sparse representation' in the context of NLP feature vectors?

A. A vector containing only negative numbers
B. A vector with mostly non-zero values
C. A vector with a small dimension
D. A vector where most elements are zero

20 Which component of the Naive Bayes classifier represents the 'Evidence' in Bayes' rule?

A. P(Data | Class)
B. P(Class | Data)
C. P(Class)
D. P(Data)

21 In Logistic Regression, what is the dimension of the weight vector θ if the feature vector x has dimension V+1?

A. V
B. V+1
C. V*2
D. 1

22 Which algorithm is considered a 'Generative' model?

A. Perceptron
B. Naive Bayes
C. Support Vector Machine
D. Logistic Regression

23 Which algorithm is considered a 'Discriminative' model?

A. Gaussian Mixture Model
B. Naive Bayes
C. Hidden Markov Model
D. Logistic Regression

24 What is the 'Lambda' (λ) term in the context of Naive Bayes ratio calculation?

A. The bias unit
B. The smoothing parameter
C. The number of classes
D. The learning rate

25 When extracting features for Logistic Regression, if the word 'happy' appears 3 times in a tweet, and 'happy' has a positive frequency of 100 and negative frequency of 5 in the corpus, how is this typically utilized?

A. The number 3 is the only feature used
B. The word is ignored
C. The ratio 100/5 is used as the weight
D. The counts 100 and 5 contribute to the aggregate sums in the feature vector

26 What is the main advantage of Logistic Regression over Naive Bayes?

A. It handles missing data better
B. It is always faster to train
C. It does not require independent features
D. It is a generative model

27 In the context of Naive Bayes, what is V?

A. The number of classes
B. The validation set size
C. The vector dimension
D. The vocabulary size (number of unique words)

28 If the learning rate in Logistic Regression is too large, what might happen?

A. The cost function becomes 0 immediately
B. The model will always find the global minimum
C. The model may overshoot the minimum and fail to converge
D. The model converges very slowly

29 Which of the following is a hyperparameter in Logistic Regression?

A. The weight vector θ
B. The feature vector x
C. The learning rate α
D. The bias term

30 How is the 'Log Prior' calculated for the positive class?

A. log(N_pos / N_total)
B. log(N_pos / N_neg)
C. log(V)
D. log(N_neg / N_pos)

31 What is the range of values for the output of the standard Naive Bayes probability calculation P(y|x) before applying logs?

A. [0, 100]
B. (-infinity, +infinity)
C. [-1, 1]
D. [0, 1]

32 Which sentiment lexicon is purely generated from the training data in the approaches discussed?

A. SentiWordNet
B. Google Dictionary
C. WordNet
D. The Lambda dictionary (Log Likelihood ratios of words)

33 When predicting with Naive Bayes, if a word in the test sentence is not in the training vocabulary (V), what is the standard action?

A. Re-train the model
B. Halt the program
C. Assign it a random probability
D. Discard it (ignore it)

34 What is 'Sentiment Analysis' primarily classifying?

A. The grammatical structure
B. The emotional tone or opinion (e.g., Positive/Negative)
C. The language of the text
D. The topic of the text

35 In Logistic Regression, the decision boundary is:

A. Circular
B. Polynomial
C. Linear
D. Non-linear

36 The denominator for calculating P(w|class) with Laplacian smoothing is:

A. N_class (total words in class) + V (vocabulary size)
B. V
C. N_class
D. Count(w in class) + 1

37 What does a negative value in a word's Log Likelihood (Lambda) score imply in Sentiment Analysis?

A. The word is a stop word
B. The word is neutral
C. The word is indicative of Negative sentiment
D. The word is indicative of Positive sentiment

38 Which of the following is a stop word?

A. Love
B. Terrible
C. Amazing
D. The

39 In a confusion matrix for binary classification, what is a False Positive?

A. Correctly predicting negative
B. Incorrectly predicting negative when the actual class is positive
C. Incorrectly predicting positive when the actual class is negative
D. Correctly predicting positive

40 What is the primary reason for lowercasing text during preprocessing?

A. To remove punctuation
B. To detect sentence boundaries
C. To ensure 'Good' and 'good' are treated as the same feature
D. It looks better

41 If a Logistic Regression model is overfitted, how will it perform?

A. Well on training data, well on test data
B. Poorly on training data, poorly on test data
C. Well on training data, poorly on test data
D. Poorly on training data, well on test data

42 Which formula represents the update rule for weight θ_j in Gradient Descent?

A. θ_j := θ_j + α * dJ/dθ_j
B. θ_j := θ_j - α * dJ/dθ_j
C. θ_j := θ_j / α
D. θ_j := dJ/dθ_j

43 In Naive Bayes, what assumption allows us to multiply probabilities of individual words?

A. Conditional Independence
B. Homoscedasticity
C. Normal Distribution
D. Linear Separability

44 What is Tokenization?

A. Removing special characters
B. Converting words to numbers
C. Translating text
D. Splitting a string of text into individual words or terms

45 Which value of probability corresponds to the logit (log-odds) value of 0?

A. 1
B. 0
C. 0.5
D. Infinity

46 What is the interpretation of weights in Logistic Regression for Sentiment Analysis?

A. They represent the frequency of words
B. They are random numbers
C. They represent the importance and direction (positive/negative) of a feature
D. They represent the index of the word

47 For a balanced dataset, which metric is most straightforward to evaluate performance?

A. Precision only
B. Mean Squared Error
C. Accuracy
D. Recall only

48 In vector space models, what is 'Oov'?

A. Over optimization value
B. Object oriented vector
C. Out of vocabulary
D. Out of vector

49 The conditional probability P(Word|Positive) is conceptually similar to:

A. The probability that the sentiment is Positive given the word
B. The probability of the word being a stop word
C. How often the word appears in the whole dataset
D. How likely the word is to appear if the sentiment is known to be Positive

50 Which technique is essentially a 'probabilistic classifier' based on applying Bayes' theorem?

A. K-Means
B. Decision Trees
C. Naive Bayes
D. K-Nearest Neighbors