Learn Before
Example
Viterbi Algorithm Matrix Computation Example
We begin in column 1 (for the word "Janet") by setting the Viterbi value in each cell to the product of the transition probability and the observation likelihood of the word "Janet" given the tag for that cell. Most of the cells in the column are zero since the word "Janet" cannot be any of those tags. Next, each cell in the "will" column gets updated. For each state, we compute the value by taking the maximum over the extensions of all the paths from the previous column that lead to the current cell according to: The remaining value is multiplied by the relevant observation probability, and the (trivial) max is taken.

0
1
Updated 2026-05-18
Contributors are:
Who are from:
Tags
Data Science