認識計算用の Hidden Marcov Model [詳細]
#include <sent/stddefs.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
データ構造 | |
struct | _a_cell |
Transition arc of HMM state. [詳細] | |
struct | HMM_STATE |
HMM State [詳細] | |
struct | HMM |
HMM state sequence [詳細] | |
struct | _seg_token |
型定義 | |
typedef struct _a_cell | A_CELL |
Transition arc of HMM state. | |
typedef struct _seg_token | SEGTOKEN |
関数 | |
HMM * | new_make_word_hmm (HTK_HMM_INFO *, HMM_Logical **, int) |
HMM * | new_make_word_hmm_with_lm (HTK_HMM_INFO *, HMM_Logical **, int, LOGPROB *) |
void | free_hmm (HMM *) |
LOGPROB | viterbi_segment (HMM *hmm, HTK_Param *param, int *endstates, int ulen, int **id_ret, int **seg_ret, LOGPROB **uscore_ret, int *retlen) |
Perform Viterbi alignment. | |
void | make_log_tbl () |
Generate a value tables of . | |
LOGPROB | addlog (LOGPROB x, LOGPROB y) |
LOGPROB | addlog_array (LOGPROB *x, int n) |
boolean | outprob_init (HTK_HMM_INFO *hmminfo, HTK_HMM_INFO *gshmm, int gms_num, int gprune_method, int gprune_mixnum) |
boolean | outprob_prepare (int framenum) |
void | outprob_free () |
boolean | outprob_cache_init () |
boolean | outprob_cache_prepare () |
void | outprob_cache_free () |
LOGPROB | outprob_state (int t, HTK_HMM_State *stateinfo, HTK_Param *param) |
Compute output probability of a state. | |
void | outprob_cd_nbest_init (int num) |
void | outprob_cd_nbest_free () |
LOGPROB | outprob_cd (int t, CD_State_Set *lset, HTK_Param *param) |
LOGPROB | outprob (int t, HMM_STATE *hmmstate, HTK_Param *param) |
boolean | gms_init (int nbest) |
boolean | gms_prepare (int framelen) |
void | gms_free () |
LOGPROB | gms_state () |
void | gms_gprune_init (HTK_HMM_INFO *hmminfo, int gsset_num) |
void | gms_gprune_prepare () |
void | gms_gprune_free () |
void | compute_gs_scores (GS_SET *gsset, int gsset_num, LOGPROB *scores_ret) |
LOGPROB | calc_mix () |
Compute the output probability of current state OP_State. | |
boolean | calc_tied_mix_init () |
boolean | calc_tied_mix_prepare (int framenum) |
void | calc_tied_mix_free () |
LOGPROB | calc_tied_mix () |
Compute the output probability of current state OP_State on tied-mixture model. | |
void | put_hmm_arc (HMM *d) |
void | put_hmm_outprob (HMM *d) |
void | put_hmm (HMM *d) |
認識計算用の Hidden Marcov Model
このファイルでは, 認識におけるHMMの構造体を定義しています. 認識時には, 辞書および音響モデル構造体 (htk_hmm.h) を元に 必要な単語HMMや木構造化辞書がこの構造体を用いて構築され, 音響尤度計算はこの上で行われます.
hmm.h で定義されています。
typedef struct _seg_token SEGTOKEN |
Token definition for viterbi segmentation.
HMM* new_make_word_hmm | ( | HTK_HMM_INFO * | hmminfo, | |
HMM_Logical ** | hdseq, | |||
int | hdseqlen | |||
) |
Make a HMM instance for recognition from phoneme sequence.
hmminfo | [in] HTK HMM definitions data | |
hdseq | [in] phoneme sequence as given by pointer list of logical HMM | |
hdseqlen | [in] length of above |
参照元 do_align(), と scan_word().
HMM* new_make_word_hmm_with_lm | ( | HTK_HMM_INFO * | hmminfo, | |
HMM_Logical ** | hdseq, | |||
int | hdseqlen, | |||
LOGPROB * | lscore | |||
) |
Make a HMM instance for recognition from phoneme sequence, with connection probabiliry given for each phoneme.
hmminfo | [in] HTK HMM definitions data | |
hdseq | [in] phoneme sequence as given by pointer list of logical HMM | |
hdseqlen | [in] length of above | |
lscore | [in] list of log probability to be added at the emitting transition of each phoneme, or NULL if not needed. |
参照元 new_make_word_hmm().
void free_hmm | ( | HMM * | d | ) |
LOGPROB viterbi_segment | ( | HMM * | hmm, | |
HTK_Param * | param, | |||
int * | endstates, | |||
int | ulen, | |||
int ** | id_ret, | |||
int ** | seg_ret, | |||
LOGPROB ** | uscore_ret, | |||
int * | slen_ret | |||
) |
Perform Viterbi alignment.
This function performs viterbi alignment for the given sentence HMM, input parameter and unit definition. Any segmentatino unit (word, phoneme state, etc.) is allowed: the segmentation unit should be specified by specifying a list of state id which are the end of each unit. For example, if you want to obtain phoneme alignment, the list of state number that exist at the end of phones should be specified by endstates.
hmm | [in] sentence HMM to be matched | |
param | [in] input parameter data | |
endstates | [in] list of state id that corrsponds to the ends of units | |
ulen | [in] total number of units in the hmm | |
id_ret | [out] Pointer to store the newly allocated array of the resulting id sequence of units on the best path. | |
seg_ret | [out] Pointer to store the newly allocated array of the resulting end frame of each unit on the best path. | |
uscore_ret | [out] Pointer to store the newly allocated array of the resulting score at the end frame of each unit on the best path. | |
slen_ret | [out] Pointer to store the total number of units on the best path. |
vsegment.c の 50 行で定義されています。
参照元 do_align().
void make_log_tbl | ( | ) |
Generate a value tables of .
is from 0 to (- VRANGE), and table size is TBLSIZE.
参照元 outprob_init().
Rapid computation of .
a | [in] array of log values | |
n | [in] length of above |
参照元 calc_mix(), calc_tied_mix(), と gmm_calc_mix().
boolean outprob_init | ( | HTK_HMM_INFO * | hmminfo, | |
HTK_HMM_INFO * | gshmm, | |||
int | gms_num, | |||
int | gprune_method, | |||
int | gprune_mixnum | |||
) |
Initialize and setup acoustic computation functions.
select functions
outprob_init.c の 62 行で定義されています。
参照元 final_fusion().
boolean outprob_prepare | ( | int | framenum | ) |
Prepare for the next input of given frame length.
framenum | [in] input length in frame. |
outprob_init.c の 158 行で定義されています。
void outprob_free | ( | ) |
Free all work area for outprob computation.
outprob_init.c の 177 行で定義されています。
boolean outprob_cache_init | ( | ) |
Initialize the cache data, should be called once on startup.
参照元 outprob_init().
boolean outprob_cache_prepare | ( | ) |
Prepare cache for the next input, by clearing the existing cache.
参照元 outprob_prepare().
void outprob_cache_free | ( | ) |
LOGPROB outprob_state | ( | int | t, | |
HTK_HMM_State * | stateinfo, | |||
HTK_Param * | param | |||
) |
Compute output probability of a state.
Set the needed values to the global variables that begins with "OP_", and call calc_outprob_state(). The calc_outprob_state() is actually a function pointer, and the entity is either calc_tied_mix() for tied-mixture model and calc_mix() for others. (If you use GMS, the entity will be gms_state() instead.)
The state-level cache is also consulted here.
参照元 next_word(), outprob(), outprob_cd_avg(), outprob_cd_max(), outprob_cd_nbest(), outprob_style(), と start_word().
void outprob_cd_nbest_init | ( | int | num | ) |
Initialize work area for outprob_cd_nbest().
num | [in] number of top states to be calculated. |
参照元 outprob_init().
void outprob_cd_nbest_free | ( | ) |
LOGPROB outprob_cd | ( | int | t, | |
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) |
Compute the log output probability of a pseudo state set.
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
参照元 next_word(), outprob(), outprob_style(), と start_word().
Top function to compute the output probability of a HMM state.
t | [in] input frame | |
hmmstate | [in] HMM state | |
param | [in] input parameter data |
参照元 scan_word(), と viterbi_segment().
boolean gms_init | ( | int | nbest | ) |
Initialize the GMS related functions and data.
nbest | [in] N-best state to compute the precise triphone. |
参照元 outprob_init().
boolean gms_prepare | ( | int | framenum | ) |
Setup GMS parameters for next input.
framenum | [in] length of next input in frames |
参照元 outprob_prepare().
void gms_free | ( | ) |
LOGPROB gms_state | ( | ) |
Get HMM State probability of current state with Gaussiam Mixture Selection.
If the GMS HMM score of the corresponding basephone is below the N-best, the triphone score will not be computed, and the score of the GMS HMM will be returned instead as a fallback score. Else, the precise triphone will be computed and returned.
参照元 outprob_init().
void gms_gprune_init | ( | HTK_HMM_INFO * | hmminfo, | |
int | gsset_num | |||
) |
Initialization of GMS HMM likelihood computation.
hmminfo | [in] GMS HMM definition | |
gsset_num | [in] number of states in GMS HMM |
gms_gprune.c の 60 行で定義されています。
参照元 gms_init().
void gms_gprune_prepare | ( | ) |
Prepare GMS HMM computation for the next speech input.
gms_gprune.c の 75 行で定義されています。
参照元 gms_prepare().
void gms_gprune_free | ( | ) |
Main function to compute all the GMS HMM states in a frame with the input vectore specified by OP_vec. This function assumes that this will be called for sequencial frame, since it utilizes the result of previous frame for faster pruning.
gsset | [in] list of GMS HMM state set. | |
gsset_num | [in] length of above | |
scores_ret | [out] array of scores for each GMS HMM state |
gms_gprune.c の 306 行で定義されています。
参照元 do_gms().
LOGPROB calc_mix | ( | ) |
Compute the output probability of current state OP_State.
No codebook-level cache is done.
calc_mix.c の 39 行で定義されています。
参照元 outprob_init().
boolean calc_tied_mix_init | ( | ) |
Initialize codebook cache area.
calc_tied_mix.c の 57 行で定義されています。
参照元 outprob_init().
boolean calc_tied_mix_prepare | ( | int | framenum | ) |
Setup codebook cache for the next incoming input.
framenum | [in] length of the next input. |
calc_tied_mix.c の 73 行で定義されています。
参照元 outprob_prepare().
void calc_tied_mix_free | ( | ) |
LOGPROB calc_tied_mix | ( | ) |
Compute the output probability of current state OP_State on tied-mixture model.
This function assumes that the OP_state is assigned to a tied-mixture codebook. Here the output probability of Gaussian mixture component referred by OP_state is consulted to the book level cache, and if not computed yet on that input frame time, it will be computed here.
calc_tied_mix.c の 138 行で定義されています。
参照元 outprob_init().
void put_hmm_arc | ( | HMM * | d | ) |
Output transition arcs of an HMM instance.
d | [in] pointer to a HMM instance. |
put_htkdata_info.c の 160 行で定義されています。
参照元 put_hmm().
void put_hmm_outprob | ( | HMM * | d | ) |
Output output probability information of an HMM instance.
d | [in] pointer to a HMM instance. |
put_htkdata_info.c の 183 行で定義されています。
参照元 put_hmm().
void put_hmm | ( | HMM * | d | ) |