AI engineering glossary · NLP embeddings

What is viterbi algorithm?

Viterbi algorithm (also called Viterbi decoding): A dynamic-programming method that finds the single most probable sequence of hidden states for an observed sequence, by keeping only the best path into each state at every step. Its cost grows linearly with length and with the square of the number of states.

Level: advancedTopic: NLP embeddings

Viterbi algorithm: an example

With 3 tags and 5 words, Viterbi evaluates about 5 x 3 x 3 = 45 transitions instead of 3^5 = 243 full sequences.

Related terms

More NLP embeddings terms

Where you learn it

Viterbi algorithm is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.