#include <julius/julius.h>
Go to the source code of this file.
Functions | |
void | bt_init (BACKTRELLIS *bt) |
Initialize backtrellis that will hold the whole word trellis (called once on startup). | |
void | bt_prepare (BACKTRELLIS *bt) |
Prepare backtrellis for the next input (called at beginning of each speech segment). | |
void | bt_free (BACKTRELLIS *bt) |
Free memories of backtrellis. | |
TRELLIS_ATOM * | bt_new (BACKTRELLIS *bt) |
Allocate a new trellis word atom. | |
void | bt_store (BACKTRELLIS *bt, TRELLIS_ATOM *tatom) |
Store a trellis word generated on the 1st pass for the 2nd pass. | |
void | bt_relocate_rw (BACKTRELLIS *bt) |
Re-locate the stored atom lists per frame (will be called after the 1st pass). | |
void | set_terminal_words (RecogProcess *r) |
When using progressive decoding with short pause segmentation, This function extracts the best word hypothesis on head and tail of the current input segment just after the 1st pass ends, and store them as start/end word in the following 2nd pass. | |
void | bt_discount_pescore (WCHMM_INFO *wchmm, BACKTRELLIS *bt, HTK_Param *param) |
Discount the output probabilities of the last state from the accumulated score on word edge for all trellis words survived on the 1st pass, for the acoustic re-computation on the 2nd pass. | |
void | bt_discount_lm (BACKTRELLIS *bt) |
Subtract 2-gram scores at each trellis word for the 2nd pass. | |
static int | compare_wid (TRELLIS_ATOM **a, TRELLIS_ATOM **b) |
qsort callback for bt_sort_rw(). | |
void | bt_sort_rw (BACKTRELLIS *bt) |
Sort the trellis words in the backtrellis by the word IDs per each frame, for rapid access on the 2nd pass. | |
TRELLIS_ATOM * | bt_binsearch_atom (BACKTRELLIS *bt, int t, WORD_ID wkey) |
Search a word on the specified frame in a word trellis data. |
Functions to store the result of the 1st pass as "word trellis", and functions to access them from the 2nd pass are defined in this file. On the 1st pass of Julius, all the promising words whose word end has been survived at the 1st pass will be stored as "word trellis", which consists of surviving words: word boundary, accumulated score and word history.
The trellis word will be stored per frame at the 1st pass. After the 1st pass ended, the word trellis will be re-organized and indexed by frame to prepare for access at the 2nd pass.
In the 2nd pass of reverse stack decoding, this word trellis will be used to constrain the word hypothesis, and also used to estimate the score of unseen area by the obtained backward scores in the 1st pass. Thus the word trellis information is also called as "back trellis" in Julius.
Definition in file backtrellis.c.
void bt_init | ( | BACKTRELLIS * | bt | ) |
Initialize backtrellis that will hold the whole word trellis (called once on startup).
bt | [in] pointer to the backtrellis structure to initialize |
Definition at line 79 of file backtrellis.c.
Referenced by j_launch_recognition_instance().
void bt_prepare | ( | BACKTRELLIS * | bt | ) |
Prepare backtrellis for the next input (called at beginning of each speech segment).
bt | [in] pointer to the word trellis structure |
Definition at line 104 of file backtrellis.c.
void bt_free | ( | BACKTRELLIS * | bt | ) |
Free memories of backtrellis.
bt | [out] pointer to the word trellis structure. |
Definition at line 131 of file backtrellis.c.
Referenced by j_recogprocess_free().
TRELLIS_ATOM* bt_new | ( | BACKTRELLIS * | bt | ) |
Allocate a new trellis word atom.
bt | [out] pointer to the word trellis structure. |
Definition at line 154 of file backtrellis.c.
void bt_store | ( | BACKTRELLIS * | bt, | |
TRELLIS_ATOM * | tatom | |||
) |
Store a trellis word generated on the 1st pass for the 2nd pass.
This function just store the new atom into backtrellis. They will be re-located per frame after 1st pass for quick access in the 2nd pass.
bt | [i/o] backtrellis structure to store the trellis word | |
tatom | [in] the trellis word to be stored |
Definition at line 190 of file backtrellis.c.
void bt_relocate_rw | ( | BACKTRELLIS * | bt | ) |
Re-locate the stored atom lists per frame (will be called after the 1st pass).
bt | [i/o] word trellis structure |
Definition at line 218 of file backtrellis.c.
void set_terminal_words | ( | RecogProcess * | r | ) |
When using progressive decoding with short pause segmentation, This function extracts the best word hypothesis on head and tail of the current input segment just after the 1st pass ends, and store them as start/end word in the following 2nd pass.
r | [in] recognition process instance |
Definition at line 295 of file backtrellis.c.
Referenced by finalize_segment().
void bt_discount_pescore | ( | WCHMM_INFO * | wchmm, | |
BACKTRELLIS * | bt, | |||
HTK_Param * | param | |||
) |
Discount the output probabilities of the last state from the accumulated score on word edge for all trellis words survived on the 1st pass, for the acoustic re-computation on the 2nd pass.
The acousitic likelihood of the word edge state will be re-computed when the next word hypotheses are expanded on the next 2nd pass.
wchmm | [in] tree lexicon | |
bt | [in] word trellis structure | |
param | [in] input parameter |
Definition at line 367 of file backtrellis.c.
void bt_discount_lm | ( | BACKTRELLIS * | bt | ) |
Subtract 2-gram scores at each trellis word for the 2nd pass.
bt | [in] word trellis |
Definition at line 401 of file backtrellis.c.
static int compare_wid | ( | TRELLIS_ATOM ** | a, | |
TRELLIS_ATOM ** | b | |||
) | [static] |
qsort callback for bt_sort_rw().
a | [in] first element | |
b | [in] second element |
Definition at line 439 of file backtrellis.c.
Referenced by bt_sort_rw().
void bt_sort_rw | ( | BACKTRELLIS * | bt | ) |
Sort the trellis words in the backtrellis by the word IDs per each frame, for rapid access on the 2nd pass.
This should be called just after bt_relocate_rw() was called.
bt | [i/o] word trellis structure |
Definition at line 468 of file backtrellis.c.
TRELLIS_ATOM* bt_binsearch_atom | ( | BACKTRELLIS * | bt, | |
int | t, | |||
WORD_ID | wkey | |||
) |
Search a word on the specified frame in a word trellis data.
bt | [in] word trellis structure | |
t | [in] word end frame on which to search | |
wkey | [in] word ID to search |
Definition at line 509 of file backtrellis.c.
Referenced by next_word(), and start_word().