Viterbi: Keep an optimal path for each endpoint

Use dynamic planning to avoid enumerating all label sequences and to understand backtraces.

• Step by stepCollate in 1 diagram2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives 2 first fixes

Try to do it after reading

  • Use dynamic planning to avoid enumerating all label sequences and to understand backtraces.
  • Check the input, label and evaluation conditions in the example

Suggested first

  • Text Tasks and Language Expressions
  • Conditional probability and vector calculations

How does the path of index numbers shrink

A sentence with a length of T has K labels for each location and a T sub-sequence of K. Viterbi uses the local reliance of the model: the same historical information can be seen in the future when the same moment, the same label, is reached. Therefore, it is sufficient to retain the prefix that scored the highest in this state, and the remaining prefix will not be reversed under the same follow-up.

Keep the best accumulated fractions of each grid, while saving which front-driver labels from. Lists the K status at the time of the transfer, comparing the fractions with the transfer fractions and adding the current observed scores. (b) The best endpoint is selected and the pointer is traced back to the end of the position before the entire path is obtained; Saves only the maximum value per step and loses the historical selection.

Two steps to test the intuition

Set the best scores for the first step status A, B to be 5 and 4. The transfer scores from step 2 to A were negative3 and negative2 respectively, and from B were 1 and 0 respectively, and were not observed. Step 2 A gets max(2,6) = 6, from B; Step 2 B gets max(6,4) = 6, from A.

As can be seen, the first step with a lower score B is the best advance to reach A. If at first only the highest overall A is kept greedy, this path of possible victory will be lost. Dynamic planning is the best prefix for each state and not for one global winner per round.

Maximum path is different from probability

Viterbi uses the maximum operation to get the highest score sequence. (a) The forward algorithm calculates the total probability of observing or subfunction functions by summating all the forward drive paths; The logarithmic field corresponds to log-sum-exp. The question of replacing the maximum with the question of post-conciliation has changed and the two outcomes cannot be described as the same level of confidence.

The typical time complexity is T multiplied by the square of K, and the retrospective storage is approximately T multiplied by K. Only the best score is required to save two rows in scrolling, but the return path still requires a pointer or an extra recalculation. The state of impatience should be marked as negative, and the end of the constraint should be added, not as a legal path with zero points.

Achievement tests can begin with sentences of length 3, label 2, complete with eight paths, and compare dynamic planning scores and paths. It will also test stabilization rules, empty sequences, illegal transfers and long batch maskes for parallel points. These details are easier to locate errors than a fraction of a random large sample.

Two optimal extensions for ViterbiTeaching: Orange Lines B → A With the Green Line A → B The maximum cumulative score for each endpoint is formed.Time 1: Best prefix for each stateTime 2: Keep the best move to the endA . Score 5B . Score 4A · max(2,6) = 6B · max(6,4) = 6−30+2+1(a) Different best forward driving at different endpoints; Can't leave only one winner for each round.
Teaching: Orange Lines B → A With the Green Line A → B The maximum cumulative score for each endpoint is formed.

Check understanding

Why can't we just keep one of the highest scores in the last round?

There are different types of follow-up transfers. A lower stage state may obtain the ultimate best path through a more favourable transfer, and an optimal prefix must be retained for each state.

Does Viterbi's best path probability represent the total probability of all correct sequences?

Can't. It selects only one path and does not combine other possible sequences. Computes the quality of all paths by using a forward-looking matching algorithm.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Jurafsky and Martin — Sequence Labeling
  2. Michael Collins — Log-Linear Models, MEMMs, and CRFs

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.