I would like to find the likelihood of a sequence of characters (the test data), given two unigram models.

The sequence (test data) is:


The models are:

       Model 1       Model 2
P(A)     0.3           0.4  
P(B)     0.4           0.5  
P(C)     0.3           0.1

Basically, I would like to know the likelihood, and if I can make a prediction as to which model the sequence belong and the underlying assumptions. I understand that given any unigram language model, the likelihood (or probability) of any sequence of characters is p(sequence of characters|Model).

What I have done so far was to find the MLE for each character:

P(A) = $\frac{1}{5}$ ; P(B) = $\frac{2}{5}$ ; P(C) = $\frac{1}{5}$

I don't know how to compute p(sequence of characters|Model). Should I multiply these to find the likelihood and establish which model it came from? How to handle the model probabilities given?

Thanks in advance :-)


I found that to compute p(sequence of characters|Model) you just have to multiply the probabilities of each character in the model by the number of times it appear in the test sequence. E.g. model 1, it is simply: $0.3 * 0.4 * 0.3 * 0.4 * 0.4$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.