Assume the following likelihoods for each word being part of a positive or negative…
Jump to turn (21)
- 1Assume the following likelihoods for each word being part of a positive or negat
- 2Given the following short movie reviews, each labeled with a genre, either comed
- 3Train two models, multinomial naive Bayes and binarized naive Bayes, both with a
- 4Write out the equation for trigram probability estimation (modifying Eq. 3.11).
- 5Calculate the probability of the sentence i want chinese food. Give two probabil
- 6Which of the two probabilities you computed in the previous exercise is higher,
- 7We are given the following corpus, modified from the one in the chapter: I am Sa
- 8Suppose we didn’t use the end-symbol . Train an unsmoothed bigram grammar on the
- 9Suppose we train a trigram language model with add-one smoothing on a given corp
- 10Write a program to compute unsmoothed unigrams and bigrams.
- 11Run your n-gram program on two different small corpora of your choice (you might
- 12Add an option to your program to generate random sentences.
- 13Add an option to your program to compute the perplexity of a test set.
- 14You are given a training set of 100 numbers that consists of 91 zeros and 1 each
- 15Write regular expressions for the following languages. the set of all alphabetic
- 16Write regular expressions for the following languages. By “word”, we mean an alp
- 17Implement an ELIZA-like program, using substitutions such as those described on
- 18Compute the edit distance (using insertion cost 1, deletion cost 1, substitution
- 19figure out whether drive is closer to brief or to divers and what the edit dista
- 20Now implement a minimum edit distance algorithm and use your hand-computed resul
- 21Augment the minimum edit distance algorithm to output an alignment; you will nee
- User
Assume the following likelihoods for each word being part of a positive or negative movie review, and equal prior probabilities for each class. pos neg I 0.09 0.16 always 0.07 0.06 like 0.29 0.06 foreign 0.04 0.15 films 0.08 0.11 What class will Naive bayes assign to the sentence “I always like foreign films.”?
- Assistant
To use Naive Bayes to assign a class to the sentence "I always like foreign films", we need to calculate the likelihood of the sentence belonging to each class (positive or negative) and then compare the results.
The likelihood of the sentence belonging to the positive class is:
P("I always like foreign films" | positive) = P("I" | positive) * P("always" | positive) * P("like" | positive) * P("foreign" | positive) * P("films" | positive) = 0.09 * 0.07 * 0.29 * 0.04 * 0.08 = 6.04 x 10^-6
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.