简体   繁体   English

为单词定义隐藏的马尔可夫模型

[英]Define hidden markov model for word

I'm attempting to define a hidden markov model and predict if given sequence of words is correct using Viterbi algorithm ( https://en.wikipedia.org/wiki/Viterbi_algorithm ). 我正在尝试定义一个隐藏的马尔可夫模型,并使用维特比算法( https://en.wikipedia.org/wiki/Viterbi_algorithm )预测给定的单词序列是否正确。 In order to aid understanding I've attempted to define the model paramters : 为了帮助理解,我尝试定义模型参数:

The letters in the corpus are abbd . 语料库中的字母是abbd From this I've defined : 由此我定义:

states : a,b,b,d

trans_p (transition probabilities) : 
There are
 a : 1/4
 b : 2/4
 d : 1/4

emit_p (emission probabilities) : 
 count(a->b) / count(a) = 1/1 = 1
 count(b->b) / count(b) = 1/2 = 1/2
 count(b->d) / count(b) = 1/2 = 1/2

Is above correct ? 以上正确吗?

Do I need to define transition probabilities for d ? 我是否需要定义d转移概率? Do I need to define emission probabilities for b->a & b->d ? 我是否需要定义b->ab->d发射概率?

I also refer to : https://stats.stackexchange.com/questions/212961/calculating-emission-probability-values-for-hidden-markov-model-hmm which aided in defining emission probabilities. 我还参考: https : //stats.stackexchange.com/questions/212961/calculating-emission-probability-values-for-hidden-markov-model-hmm ,它有助于定义排放概率。

I think you are confusing emission probabilities with transition probabilities. 我认为您正在将排放概率与过渡概率混淆。 When defining an HMM, you need to define 定义HMM时,需要定义

  • a set of (hidden) states, a set of observables, 一组(隐藏)状态,一组可观测值,
  • a state transition matrix describing the probability of going from one space to the next 描述从一个空间到另一个空间的概率的状态转换矩阵
  • emission probabilities describing the probability of observing one observable from a given (hidden) state 发射概率描述了从给定(隐藏)状态观察到一个可观察到的概率
  • an initial state probability vector describing what is your probability of starting in a given state. 初始状态概率向量,描述您从给定状态开始的概率。

If they are in you corpus, I suppose that a,b and d are your observables, not your states. 如果它们在您的语料库中,我想a,b和d是您的可观察对象,而不是您的状态。 You need to define relevant states to complete your HMM. 您需要定义相关状态以完成HMM。 If you can observe the state, then your Markov model is not hidden, it's a plain Markov model and there is not need for the Viterbi algorithm 如果您可以观察到状态,则不会隐藏您的马尔可夫模型,这是一个普通的马尔可夫模型,不需要维特比算法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM