Edinburgh Speech Tools 2.4-release
EST_Viterbi_Decoder Class Reference

#include <include/EST_viterbi.h>

Collaboration diagram for EST_Viterbi_Decoder:

Public Member Functions

 EST_Viterbi_Decoder (uclist_f_t a, unpath_f_t b)
 
 EST_Viterbi_Decoder (uclist_f_t a, unpath_f_t b, int num_states)
 
void set_beam_width (int w)
 Only for use in beam search mode: number of paths to consider. More...
 
void set_cand_width (int w)
 Only for use in beam search mode: number of candidates to consider. More...
 
void set_debug (int d)
 Output some debugging information. More...
 
void set_big_is_good (int flag)
 
EST_VTCandidateadd_cand_prune (EST_VTCandidate *newcand, EST_VTCandidate *allcands)
 
bool vit_prune_path (double path_score, double score_cutoff)
 
void initialise (EST_Relation *r)
 Build the initial table from a \Ref{EST_Relation}. More...
 
void set_pruning_parameters (float beam, float ob_beam)
 set beam widths for pruning More...
 
void turn_on_debug ()
 
void turn_on_trace ()
 
void search (void)
 Do the the actual search. More...
 
bool result (const EST_String &n)
 
bool result (EST_VTPath **bestPathEnd)
 
void copy_feature (const EST_String &n)
 Copy named feature from the best path to related stream item. More...
 

Public Attributes

EST_Features f
 For holding values to pass to user called functions. More...
 
const double vit_a_big_number
 Unfortunately using MAX_DOUBLE doesn't do the right thing (e.g. comparison don't work with MAX_DOUBLE on alphas), so we declare our own large number. More...
 

Detailed Description

A class that offers a generalised Viterbi decoder.

This class can be used to find the best path through a set of candidates based on likelihoods of the candidates and some combination function. The candidate list and joining are not included in the decoder itself but are user defined functions that are specified at construction time.

Those functions need to return a list of candidates and score a join of a path to a candidate and (optionally define a state).

Although this offers a full Viterbi search it may also be used as a generalised beam search.

See {\tt viterbi_main.cc} for an example of using this.

Author
Alan W Black (awb@c.nosp@m.str..nosp@m.ed.ac.nosp@m..uk): July 1996

Definition at line 130 of file EST_viterbi.h.

Constructor & Destructor Documentation

◆ EST_Viterbi_Decoder() [1/2]

EST_Viterbi_Decoder::EST_Viterbi_Decoder ( uclist_f_t  a,
unpath_f_t  b 
)

Construct a decoder with given candidate function and join function, as number of states is given this implies a beam search

Definition at line 65 of file EST_viterbi.cc.

◆ EST_Viterbi_Decoder() [2/2]

EST_Viterbi_Decoder::EST_Viterbi_Decoder ( uclist_f_t  a,
unpath_f_t  b,
int  num_states 
)

Construct a decoder with given candidate function and join function with a state size as specified.

Definition at line 83 of file EST_viterbi.cc.

◆ ~EST_Viterbi_Decoder()

EST_Viterbi_Decoder::~EST_Viterbi_Decoder ( )

Definition at line 103 of file EST_viterbi.cc.

Member Function Documentation

◆ set_beam_width()

void EST_Viterbi_Decoder::set_beam_width ( int  w)
inline

Only for use in beam search mode: number of paths to consider.

Definition at line 182 of file EST_viterbi.h.

◆ set_cand_width()

void EST_Viterbi_Decoder::set_cand_width ( int  w)
inline

Only for use in beam search mode: number of candidates to consider.

Definition at line 184 of file EST_viterbi.h.

◆ set_debug()

void EST_Viterbi_Decoder::set_debug ( int  d)
inline

Output some debugging information.

Definition at line 186 of file EST_viterbi.h.

◆ set_big_is_good()

void EST_Viterbi_Decoder::set_big_is_good ( int  flag)
inline

Define whether good scores are bigger or smaller. This allows the search to work for likelihoods probabilities, scores or whatever

Definition at line 192 of file EST_viterbi.h.

◆ add_cand_prune()

EST_VTCandidate * EST_Viterbi_Decoder::add_cand_prune ( EST_VTCandidate newcand,
EST_VTCandidate allcands 
)

Add a new candidate to list if better than others, pruning the list if required.

Definition at line 461 of file EST_viterbi.cc.

◆ vit_prune_path()

bool EST_Viterbi_Decoder::vit_prune_path ( double  path_score,
double  score_cutoff 
)

Definition at line 399 of file EST_viterbi.cc.

◆ initialise()

void EST_Viterbi_Decoder::initialise ( EST_Relation r)

Build the initial table from a \Ref{EST_Relation}.

Definition at line 108 of file EST_viterbi.cc.

◆ set_pruning_parameters()

void EST_Viterbi_Decoder::set_pruning_parameters ( float  beam,
float  ob_beam 
)

set beam widths for pruning

Definition at line 182 of file EST_viterbi.cc.

◆ turn_on_debug()

void EST_Viterbi_Decoder::turn_on_debug ( )

Definition at line 192 of file EST_viterbi.cc.

◆ turn_on_trace()

void EST_Viterbi_Decoder::turn_on_trace ( )

Definition at line 197 of file EST_viterbi.cc.

◆ search()

void EST_Viterbi_Decoder::search ( void  )

Do the the actual search.

Definition at line 203 of file EST_viterbi.cc.

◆ result() [1/2]

bool EST_Viterbi_Decoder::result ( const EST_String n)

Extract the result from the table and store it as a feature on the related \Ref{EST_Item} in the given \Ref{EST_Relation} named as {\tt n}. Return FALSE if no path is found.

Definition at line 511 of file EST_viterbi.cc.

◆ result() [2/2]

bool EST_Viterbi_Decoder::result ( EST_VTPath **  bestPathEnd)

Extract the end point of the best path found during search. Return FALSE if no path is found.

Definition at line 535 of file EST_viterbi.cc.

◆ copy_feature()

void EST_Viterbi_Decoder::copy_feature ( const EST_String n)

Copy named feature from the best path to related stream item.

Definition at line 552 of file EST_viterbi.cc.

Member Data Documentation

◆ f

EST_Features EST_Viterbi_Decoder::f

For holding values to pass to user called functions.

Definition at line 164 of file EST_viterbi.h.

◆ vit_a_big_number

const double EST_Viterbi_Decoder::vit_a_big_number

Unfortunately using MAX_DOUBLE doesn't do the right thing (e.g. comparison don't work with MAX_DOUBLE on alphas), so we declare our own large number.

Definition at line 169 of file EST_viterbi.h.


The documentation for this class was generated from the following files: