Parts of Speech Using Hidden Markov Models
Parts of Speech Using Hidden Markov Models
1. Snorlax is sleeping
2. Sleeping is a boon
20
Before understanding these methods, let's about the chance of occurrence of a part of
look at some of the terminologies. To start speech after another part of speech, while
with the PoS tagging problem, we need to emission probabilities tell us about the
have a training set of many sentences in chance of occurrence of a particular word
which we know the parts of speech of each corresponding to a part of speech.
word priorly. The collection of these
sentences is known as text corpus. In the above example, transition
probabilities include what is the probability
Lookup tables and N-grams have some that a Modal is coming after a Noun, a Verb is
serious limitations. In lookup tables, each coming after a Modal and a Noun is coming
word will get tagged to one and only one part after a Verb. Emission probabilities include
of speech each time, irrespective of the the chance that a Noun will be the word John,
context. In the case of n-gram, it is possible and a Verb will be the word see, etc. For the
that we will get some new combination of correct tagging, we want overall probabilities
words in our test set, and thus n-gram will (multiplication of all prob.) to be higher.
not be able to tag the PoS for these cases.
These limitations make lookup tables and n- Emission Probabilities
grams relatively less popular. Hidden Markov
Model and Viterbi Algorithm take care of this
problem, and we will understand how they
work in this article.
21
the parts of speech of each word are hidden to
us and not directly observable, so we call
them hidden states. There are 9 observations
and 3 hidden states in our corpus. Each
hidden state (PoS) is connected to every other
hidden state, with the transition probability,
and each hidden state is also connected to
every observation (words) by emission
Figure 2: Emission Probabilities
probabilities. The following diagram
describes this relation:
In the same way, we find all the probabilities
and represent them as follows, which is
called emission probabilities.
Transition Probabilities
Now we have both emission and We will start from <s>. One of the ways
transition probabilities. We will proceed to is to reach Noun (N) with probability 3/4. We
see them in action. The words which are there can pick the word Jane with probability 2/9,
in the corpus are called observations because and can move to Modal (M) with probability
these are the things that we can observe. But, 1/3, and can pick will with probability 3/4. We
22
can move to Verb (V) with probability 3/4, paths, there are two more paths, whose
and can pick spot with probability 1/4, and likelihood is also shown below:
can move to Noun (N) with probability 1.
Then, we can choose Will with probability
1/9. Finally, we can reach the end-of-
sentence with a probability 4/9. The above
few sentences might be complex to
understand, so let's have a look at the
following diagram to understand the flow.
This is one of the many ways to generate the
sentence: Figure 7: Third and fourth possibility of
occurrence of the above sentence
23