Using Ragel for Hidden Markov Model generation
Adrian Thurston
thurs... at cs.queensu.ca
Fri Nov 3 06:12:12 UTC 2006
Hi,
It might be possible to use Ragel as is. There is an experimental (and
undocumented) semantic condition feature which obeys the rules of NFA to
DFA conversion. A semantic condition is a block of code which is
associated with a transition. It must evaluate to true for the
transition to be taken. Conditions were introduced for the purpose of
parsing variable length fields. You could use them to do a roll of the
dice. Look in test/cond?.rl for examples of conditions.
If conditions don't cut it, then modifying Ragel might be an option.
Though I don't know enough about HMMs to say for sure if it could be
done. How are HMMs specified?
I can tell you that Ragel was designed for producing deterministic
parsers. Internally it has no epsilon transitions. Machines are made
deterministic on the fly. So it doesn't have many of the features that
comprehensive state machine libraries like Grail+ have.
Cheers,
Adrian
edward... at gmail.com wrote:
> Hi everyone,
>
> I'm interested in using Ragel as the core of a Hidden Markov Model
> (HMM) engine.
>
> As I understand it, a HMM is really just a non-deterministic finite
> state machine with probabilities that dictate the emissions and
> transition probabilities. So instead of there being a completely random
> choice between two epsilon transitions (for example), there's a
> probability for each path.
>
> Would it be a big deal to alter Ragel to support probabilities in state
> transitions?
>
> Thanks!
>
> Edward
>
>
>
More information about the ragel-users
mailing list