class SimpleDecoderSpeechHMM

This class implements a special case of Hidden Markov Models that can be used to do connected word speech recognition for small vocabulary, using embedded training.

Inheritance:


Public Fields

[more]SpeechHMM* model
The trained SpeechHMM model to decode
[more]Grammar* grammar
the acceptable grammar
[more]WordSeg* wordseg
the object containing target and obtained word sequences
[more]real log_word_entrance_penalty
log word entrance penalty: during viterbi, penalizes large sentences
[more]bool forced_alignment
should we perform forced alignment or real decoding?
[more]int* n_previous_states
for each state, how many previous states
[more]int** previous_states
for each state, the list of previous states

Public Methods

[more] SimpleDecoderSpeechHMM(SpeechHMM* model, Grammar* grammar_)
In order to create a SimpleDecoderSpeechHMM, we need to give a vector of n_models_ HMMs as well as their corresponding name, a lexicon and a grammar, an optional log_word_entrance_penalty and an optional trainer that can be used to initialize each model independently
[more]virtual void setDataSet(DataSet* data_)
this method sets the test data set to be used
[more]virtual void logViterbi(Sequence* inputs)
this method redefine the normal logViterbi class with constraint on word entrance
[more]virtual void decode(Sequence* input)
this method returns the sentence associated to the input
[more]virtual void logProbabilities(Sequence* inputs)
this method computes more efficiently the emission probabilities
[more]virtual void setPreviousStates()
prepare structure previous_states and n_previous_states
[more]virtual void prepareTestModel(Sequence* input)
this method prepare the transition graph associated with a given test sentence
[more]virtual int nStatesInGrammar()
this methods returns the number of states in the grammar


Inherited from SpeechHMM:

Public Fields

oint n_models
oHMM** models
oDataSet* data
oEMTrainer** model_trainer
oMeasurerList* initial_models_trainer_measurers
oLexiconInfo* lexicon
oSequence* targets
oint add_to_targets
obool** word_transitions
oint max_n_states
oint* states_to_model_states
oint* states_to_model
oint* states_to_word
obool phoneme_targets

Public Methods

ovirtual void prepareTrainModel(Sequence* input)
ovirtual int addWordToModel(int word, int current_state)
ovirtual void addConnectionsBetweenWordsToModel(int word, int next_word, int current_state, int next_current_state, real log_n_next)
ovirtual int nStatesInWord(int word)
ovirtual int nStatesInWordPronunciation(int word, int pronun)


Inherited from HMM:

Public Fields

oint n_states
oreal prior_transitions
oDistribution** states
oDistribution** shared_states
oreal** transitions
oreal** log_transitions
oreal** dlog_transitions
oreal** transitions_acc
oSequence* log_alpha
oSequence* log_beta
oSequence* arg_viterbi
oint last_arg_viterbi
oSequence* viterbi_sequence
oSequence* log_probabilities_s
obool initialize

Public Methods

ovirtual void printTransitions(bool real_values=false, bool transitions_only=false)
ovirtual void logAlpha(Sequence* inputs)
ovirtual void logBeta(Sequence* inputs)


Inherited from Distribution:

Public Fields

oreal log_probability
oSequence* log_probabilities

Public Methods

ovirtual real logProbability(Sequence* inputs)
ovirtual real viterbiLogProbability(Sequence* inputs)
ovirtual real frameLogProbability(int t, real* f_inputs)
ovirtual real viterbiFrameLogProbability(int t, real* f_inputs)
ovirtual void eMIterInitialize()
ovirtual void iterInitialize()
ovirtual void eMSequenceInitialize(Sequence* inputs)
ovirtual void sequenceInitialize(Sequence* inputs)
ovirtual void eMAccPosteriors(Sequence* inputs, real log_posterior)
ovirtual void frameEMAccPosteriors(int t, real* f_inputs, real log_posterior)
ovirtual void viterbiAccPosteriors(Sequence* inputs, real log_posterior)
ovirtual void frameViterbiAccPosteriors(int t, real* f_inputs, real log_posterior)
ovirtual void eMUpdate()
ovirtual void update()
ovirtual void eMForward(Sequence* inputs)
ovirtual void viterbiForward(Sequence* inputs)
ovirtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
ovirtual void viterbiBackward(Sequence* inputs, Sequence* alpha)
ovirtual void frameDecision(int t, real* decision)

Public Members

o Returns the decision of the distribution


Inherited from GradientMachine:

Public Fields

oint n_inputs
oint n_outputs
oParameters* params
oParameters* der_params
oSequence* beta

Public Methods

ovirtual void forward(Sequence* inputs)
ovirtual void backward(Sequence* inputs, Sequence* alpha)
ovirtual void setPartialBackprop(bool flag=true)
ovirtual void frameForward(int t, real* f_inputs, real* f_outputs)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)


Inherited from Machine:

Public Fields

oSequence* outputs

Public Methods

ovirtual void reset()


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

This class implements a special case of Hidden Markov Models that can be used to do connected word speech recognition for small vocabulary, using embedded training.

It contains a SpeechHMM and a grammar (which states the legal sentences of the langage).

The decoding is done by creating the whole transition matrix and hence is not adapted to large vocabulary problems.

oSpeechHMM* model
The trained SpeechHMM model to decode

oGrammar* grammar
the acceptable grammar

oWordSeg* wordseg
the object containing target and obtained word sequences

oreal log_word_entrance_penalty
log word entrance penalty: during viterbi, penalizes large sentences

obool forced_alignment
should we perform forced alignment or real decoding?

oint* n_previous_states
for each state, how many previous states

oint** previous_states
for each state, the list of previous states

o SimpleDecoderSpeechHMM(SpeechHMM* model, Grammar* grammar_)
In order to create a SimpleDecoderSpeechHMM, we need to give a vector of n_models_ HMMs as well as their corresponding name, a lexicon and a grammar, an optional log_word_entrance_penalty and an optional trainer that can be used to initialize each model independently

ovirtual void setDataSet(DataSet* data_)
this method sets the test data set to be used

ovirtual void logViterbi(Sequence* inputs)
this method redefine the normal logViterbi class with constraint on word entrance

ovirtual void decode(Sequence* input)
this method returns the sentence associated to the input

ovirtual void logProbabilities(Sequence* inputs)
this method computes more efficiently the emission probabilities

ovirtual void setPreviousStates()
prepare structure previous_states and n_previous_states

ovirtual void prepareTestModel(Sequence* input)
this method prepare the transition graph associated with a given test sentence

ovirtual int nStatesInGrammar()
this methods returns the number of states in the grammar


This class has no child classes.
Author:
Samy Bengio (bengio@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.