Question: PYTHON Consider the following sentences written in Klingon. For each sentence, the part of speech of each word has been given (for ease of translation,
PYTHON
Consider the following sentences written in Klingon. For each sentence, the part of speech of each word has been given (for ease of translation, some prefixes/suffixes have been treated as words), along with a translation. Using these training sentences, were going tobuild a Hidden Markov Model(HMM)to predict the part of speech of an unknown sentence using the Viterbi algorithm.
N PRO V N PRO
paDaq ghah taH terangan e
room (inside) he is human of
The human is in the room
V N V N
jachuqmeH rojHom neH terangan
in orderto parley truce want human
The enemy commander wants a truce in order to parley
N V N CONJ N V N
tera ngan qIp puq eg puq qIp terangan
human bit child and child bit child
The child bit the human, and the human bit the child
Step 1: Creating the Emission probability table(emission.javaor emission.py)Create a Emission probability table by computingthe frequencies of each part of speech in thetable below for all POS tags. Well use a smoothing factor of 0.1 (as discussed in class) to make sure that no event is impossible; add this number to all of your observations. Sample table valuesof two parts of speechhave been shown.Probability(word|tag) = Count(word,tag) / Count(tag)
Step by Step Solution
There are 3 Steps involved in it
The question is missing details on the specific unknown sentence for which the part of speech needs to be predicted using the Viterbi algorithm Lets proceed to provide a general overview and instructi... View full answer
Get step-by-step solutions from verified subject matter experts
