← Speech and Language Processing
NLP›Popular Textbooks› SLP · Appendix A

Appendix A

Hidden Markov Models

Appendix: Hidden Markov Models, in Daniel Jurafsky and James H. Martin, Speech and Language Processing, 3rd edition draft, August 19, 2026.

Topics to learn

Page numbers refer to the linked chapter PDF.

FAQ

Which algorithm answers which question?

Forward computes the probability of the observations. Viterbi finds the best state sequence. Forward-backward estimates the parameters from observations. Do not use the likelihood algorithm as a decoder.

Why is the forward probability not the Viterbi probability?

Forward sums over paths. Viterbi keeps the single best path. A sequence can be likely in total while its best path is not the one you would read off from the summed score.

What does forward-backward need?

Observation sequences and a model structure. It does not need gold state labels. If you already have labeled states, ordinary supervised counts are a different estimator.

Where does Chapter 18 use this appendix?

Chapter 18 applies the HMM to part-of-speech tagging. This appendix is the algorithm. The tagging chapter is the application.