julius/search_bestfirst_v1.c File Reference

Viterbi path update and hypothesis score calculation on the 2nd pass, using backscan algorithm. More...

#include <julius.h>

Include dependency graph for search_bestfirst_v1.c:

Go to the source code of this file.

Functions

void free_node_exec (NODE *node)
void free_node (NODE *node)
void clear_stocker ()
NODEcpy_node (NODE *dst, NODE *src)
NODEnewnode ()
void malloc_wordtrellis ()
void free_wordtrellis ()
void scan_word (NODE *now, HTK_Param *param)
void next_word (NODE *now, NODE *new, NEXTWORD *nword, HTK_Param *param, BACKTRELLIS *backtrellis)
void start_word (NODE *new, NEXTWORD *nword, HTK_Param *param, BACKTRELLIS *backtrellis)
void last_next_word (NODE *now, NODE *new, HTK_Param *param)

Variables

static NODEstocker_root = NULL
 < Define if want triphone debug messages Node stocker for recycle
static LOGPROBwordtrellis [2]
 Buffer to compute viterbi path of a word.
static int tn
 Temporal pointer to current buffer.
static int tl
 Temporal pointer to previous buffer.
static LOGPROBg
 Buffer to hold source viterbi scores.
static HMM_Logical ** phmmseq
 Phoneme sequence to be computed.
static int phmmlen_max
 Maximum length of phmmseq.


Detailed Description

Viterbi path update and hypothesis score calculation on the 2nd pass, using backscan algorithm.

Author:
Akinobu Lee
Date:
Sun Sep 11 23:54:53 2005
This file has functions for score calculations on the 2nd pass. It includes Viterbi path update calculation of a hypothesis, calculations of scores and word trellis connection at word expansion.

The cross-word triphone will be computed not at word expansion time, but at later pop up for rapid decoding. This is called "backscan" altgorithm. These functions are enabled when PASS2_STRICT_IWCD is UNDEFINED in config.h. If defined, "nextscan" functions in search_bestfirst_v2.c are used instead.

Here we use "delayed cross-word context handling" method for connection of next word and last word of the hypothesis for speeding up decoding:

  1. Only right context of the tail phone in the next word is considered when generating a new hypothesis (next_word()).

  1. The whole context dependency will be fully computed when the hypothesis is once pushed to stack and later popped in scan_word().

This method avoid computing full context-dependency handling for all generated hypothesis in next_word(), and only re-compute it after primising ones are popped from stack later. This speeds up decoding. But since the context dependency is not considered in the total hypothesis score (computed in next_word()).

The actual implimentation:

  1. In nextword(), the tail phone in the new word is modified considering the right context (= head phone in the last word of source hypothesis), and the outprob on the connection point between backtrellis and forward trellis is computed using the triphone.

  1. In scan_word(), not only the new word but also the head phone in the previous word should be modified and re-scanned. To realize this '1-phoneme backscan' procedure, hypothesis nodes have to keep forward scores not only at the last HMM state (g[] in NODE), but also at the backscan restart point (= before the head phone in the previous word, g_prev[] in NODE).

Note that the actual implementation becomes a little more complicated to handle 1-phoneme words...

Revision
1.5

Definition in file search_bestfirst_v1.c.


Function Documentation

void free_node_exec ( NODE node  ) 

Free a hypothesis node actually.

Parameters:
node [in] hypothesis node

Definition at line 140 of file search_bestfirst_v1.c.

Referenced by clear_stocker().

void free_node ( NODE node  ) 

Stock an unused hypothesis node for recycle.

Parameters:
node [in] hypothesis node

Definition at line 169 of file search_bestfirst_v1.c.

Referenced by free_all_nodes(), put_all_in_stack(), put_to_stack(), result_reorder_and_output(), and wchmm_fbs().

void clear_stocker (  ) 

Clear the node stocker for recycle.

Definition at line 199 of file search_bestfirst_v1.c.

NODE* cpy_node ( NODE dst,
NODE src 
)

Copy the content of node to another.

Parameters:
dst [out] target hypothesis
src [in] source hypothesis
Returns:
the value of dst.

Definition at line 238 of file search_bestfirst_v1.c.

Referenced by last_next_word().

NODE* newnode (  ) 

Allocate a new hypothesis node. If the node stocker is not empty, the one in the stocker is re-used. Otherwise, allocate as new.

Returns:
pointer to the newly allocated node.

Definition at line 314 of file search_bestfirst_v1.c.

Referenced by wchmm_fbs().

void malloc_wordtrellis (  ) 

Allocate work area for trellis computation of a word.

Definition at line 418 of file search_bestfirst_v1.c.

Referenced by wchmm_fbs().

void free_wordtrellis (  ) 

Free the work area for trellis computation of a word.

Definition at line 456 of file search_bestfirst_v1.c.

void scan_word ( NODE now,
HTK_Param param 
)

Compute the forward viterbi for the last word to update forward scores and ready for word connection.

Parameters:
now [i/o] hypothesis
param [in] input parameter vectors

Definition at line 555 of file search_bestfirst_v1.c.

void next_word ( NODE now,
NODE new,
NEXTWORD nword,
HTK_Param param,
BACKTRELLIS backtrellis 
)

Connect a new word to generate a next hypothesis. The optimal connection point and new sentence score of the new hypothesis will be estimated by looking up the corresponding words on word trellis.

Parameters:
now [in] source hypothesis
new [out] pointer to save the newly generated hypothesis
nword [in] next word to be connected
param [in] input parameter vector
backtrellis [in] word trellis

Definition at line 1353 of file search_bestfirst_v1.c.

void start_word ( NODE new,
NEXTWORD nword,
HTK_Param param,
BACKTRELLIS backtrellis 
)

Generate an initial hypothesis from given word.

Parameters:
new [out] pointer to save the newly generated hypothesis
nword [in] words of the first candidates
param [in] input parameter vector
backtrellis [in] word trellis

Definition at line 1587 of file search_bestfirst_v1.c.

Referenced by wchmm_fbs().

void last_next_word ( NODE now,
NODE new,
HTK_Param param 
)

Hypothesis termination: set the final sentence scores of hypothesis that has already reached to the end.

Parameters:
now [in] hypothesis that has already reached to the end
new [out] pointer to save the final sentence information
param [in] input parameter vectors

Definition at line 1674 of file search_bestfirst_v1.c.


Generated on Tue Dec 26 16:16:57 2006 for Julius by  doxygen 1.5.0