[10 pts] In this exercise, we’ll do some cross-domain recommendation, where we assume that there is a correlation between a user’s taste in music and film. We’ll only consider one music genre, namely jazz (which we’ll denote by J), and four films, “Waking Life” (denoted by W), “Borat” (denoted by B), “Cinema Paradiso” (denoted by C) and “Requiem for a Dream” (denoted by R). We’ll assume that conditioned on whether the user likes jazz, the movie likes/dislikes are independent. The prior probability of liking jazz is 30%. We’ve defined the following (combined) conditional probability table, where “=1” means “likes”. We are conditioning on the first column.
What is the probability the user likes jazz, given that she likes the first and fourth movies but dislikes the second and third?
How about the probability that the user likes jazz, given that she likes all the movies?
Part II: HMM naive solution (10 points)
In the remainder of this assignment, you will implement a basic Hidden Markov model. We’ll use the HMM from our in-class part-of-speech tagging example, whose states are PropNoun, Noun, Verb, Det. The transition probabilities are the same as in the example shown in class. The observation probabilities are defined as follows, and are defined in the provided file hmm_starter.m.
In a function naive_solution.m, write code to compute the probability of observing each of the following sentences, using the naive solution. You can map each word to a number that is its index into our vocabulary (the union of the column headers above, except the first one), then a sentence is just a vector of numbers; see Part III for an example. Use the provided permn.zip to compute combinations with replacement, to get your list of possible state sequences.
the transition matrix A (from hmm_starter.m),
the observation matrix B (from hmm_starter.m),
N, the number of states,
M, the number of words in the vocabulary, and
a vector of integers sent representing the sentence whose observation probability we want to compute.
prob, the probability of observing the input sentence.
Part III: Testing HMM on part-of-speech tagging (10 points)
Finally, in a script hmm_demo.m, pick five of the sentences below, and compute their probability of occurrence. In a file report.pdf/docx, discuss what you observe about which of them seem more likely than others, and whether what you observe makes sense.
“john saw the cat.” (or using our mapping to numbers, sent = [1 4 7 3];)