Questions tagged [viterbi]

The Viterbi algorithm is a dynamic programming algorithm for finding the most likely sequence of hidden states—called the Viterbi path—that results in a sequence of observed events, especially in the context of Markov information sources and hidden Markov models. Use this tag for questions about this algorithm.

The Viterbi algorithm is a dynamic programming algorithm for finding the most likely sequence of hidden states—called the Viterbi path—that results in a sequence of observed events, especially in the context of Markov information sources and hidden Markov models.

The algorithm has found universal application in decoding the convolutional codes used in both CDMA and GSM digital cellular, dial-up modems, satellite, deep-space communications, and 802.11 wireless LANs. It is now also commonly used in speech recognition, speech synthesis, diarization,1 keyword spotting, computational linguistics, and bioinformatics. For example, in speech-to-text (speech recognition), the acoustic signal is treated as the observed sequence of events, and a string of text is considered to be the "hidden cause" of the acoustic signal. The Viterbi algorithm finds the most likely string of text given the acoustic signal. (src: Wikipedia)

84 questions
43
votes
6 answers

Python Implementation of Viterbi Algorithm

I'm doing a Python project in which I'd like to use the Viterbi Algorithm. Does anyone know of a complete Python implementation of the Viterbi algorithm? The correctness of the one on Wikipedia seems to be in question on the talk page. Does…
Jeffrey
  • 1,681
  • 3
  • 13
  • 23
20
votes
3 answers

What is the difference between Forward-backward algorithm and Viterbi algorithm?

What is the difference between Forward-backward algorithm on n-gram model and Viterbi algorithm on Hidden Markov model (HMM)? When I review the implementation of these two algorithms, only thing I found is that the transaction probability is coming…
user53670
12
votes
2 answers

Finding the top - k viterbi paths in HMM

I need to write an algorithm that finds the top-k viterbi paths in a HMM (using the regular viterbi algorithm to find the best path). I think I probably need to save a list V_t,N of size k for each state N that contains the top-K paths that end in…
John Smith
  • 437
  • 5
  • 15
11
votes
1 answer

How to find the most likely sequences of hidden states for a Hidden Markov Model

The Viterbi algorithm finds the most likely sequence of hidden states in a Hidden Markov Model. I am currently using the following awesome code by hhquark. import numpy as np def viterbi_path(prior, transmat, obslik, scaled=True,…
Simd
  • 19,447
  • 42
  • 136
  • 271
11
votes
0 answers

how to get top-k best candidate sequences when using CRF for decoding in tensorflow

CRF++ allows us to get marginal probabilities for each tag (a kind of confidece measure for each output tag) and a conditional probably for the output (confidence measure for the entire output). % crf_test -v2 -m model test.data # 0.478113 Rockwell…
longbowking
  • 285
  • 2
  • 7
11
votes
1 answer

NLTK ViterbiParser fails in parsing words that are not in the PCFG rule

import nltk from nltk.parse import ViterbiParser def pcfg_chartparser(grammarfile): f=open(grammarfile) grammar=f.read() f.close() return nltk.PCFG.fromstring(grammar) grammarp = pcfg_chartparser("wsjp.cfg") VP =…
Kaushal
  • 111
  • 4
9
votes
3 answers

Viterbi training or Baum-Welch algorithm to estimate the transition and emission probabilities?

I'm trying to find the most probable path (i.e. a sequence of states) on an HMM using the Viterbi algorithm. However, I don't know the transition and emission matrices, which I need to estimate from the observations (data). To estimate these…
7
votes
2 answers

Viterbi decoder

Does anyone know for any good resource on the web or book where the explanation for Viterbi decoder or a tutorial on how to decode a received bit sequence by using trellis diagram could be found? Thanks!
Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286
6
votes
1 answer

Why are both Viterbi and Reed-Solomon used in DVB-T?

From my understanding, DVB-T packets go through two FEC systems, that are, Viterbi, with a data loss up to 50%, and RS, with a data loss up to 10%. Those are called external and internal coding. I can't understand the need for the second RS coding…
cedivad
  • 2,544
  • 6
  • 32
  • 41
5
votes
2 answers

How can I implement the Viterbi algorithm in C# to split conjoined words?

In short - I want to convert the first answer to the question here from Python into C#. My current solution to splitting conjoined words is exponential, and I would like a linear solution. I am assuming no spacing and consistent casing in my input…
5
votes
1 answer

r - viterbi RHmm Error protection stack overflow

I was looking for a HMM implementation in R to analyze states in a string of characters and the HMM library seems to run slow, then I am using the RHmm library. My data is a string of 1953138 symbols (U,D,N) this is a sample of my data: string <-…
Sierra
  • 51
  • 3
5
votes
2 answers

Are start and end states in HMM, necessary when implementing the Viterbi Algorithm for POS tagging?

I do not fully understand how to use the start and end states in the Hidden Markov Model. Are these necessary in order to design and implement the transition and emission matrices?
Michael
  • 791
  • 2
  • 12
  • 32
5
votes
2 answers

Viterbi algorithm in java

I'm doing the coursera NLP course and the first programming assignment is to build a Viterbi decoder. I think I'm really close to finishing it but there is some elusive bug which I cannot seem to be able to trace. Here is my code:…
LordDoskias
  • 3,121
  • 3
  • 30
  • 44
4
votes
1 answer

What does probabilities estimated at the boundary mean? Hidden Markov Models in R using depmixS4 package

I am new to Hidden Markov Models and I am currently trying to use continuous HMM to predict 6 activities on the UCI Human Activity Recognition data set (composed of accelerometer and gyroscope values) in R. I have both train data and test data, and…
4
votes
2 answers

Viterbi algorithm for second order HMM

I am trying to find some (preferably MATLAB) code for the Viterbi algorithm in a 2nd order HMM. I know how to apply it for a first order model, and understand the concept for 2nd order. However I am having trouble implementing it for a 2nd order…
alguru
  • 404
  • 6
  • 16
1
2 3 4 5 6