#include "search.h"
Include dependency graph for extern.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | bt_init (BACKTRELLIS *bt) |
void | bt_prepare (BACKTRELLIS *bt) |
void | bt_store (BACKTRELLIS *bt, TRELLIS_ATOM *aotm) |
void | bt_relocate_rw (BACKTRELLIS *bt) |
void | bt_discount_pescore (WCHMM_INFO *wchmm, BACKTRELLIS *bt, HTK_Param *param) |
void | bt_sort_rw (BACKTRELLIS *bt) |
TRELLIS_ATOM * | bt_binsearch_atom (BACKTRELLIS *bt, int time, WORD_ID wkey) |
void | make_iwcache_index (WCHMM_INFO *wchmm) |
Make a list of word head nodes on which cross-word factoring cache is needed. | |
void | make_successor_list (WCHMM_INFO *wchmm) |
boolean | can_succeed (WCHMM_INFO *wchmm, WORD_ID lastword, int node) |
void | get_back_trellis_init (HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis) |
Frame synchronous beam search: the fist frame. | |
boolean | get_back_trellis_proceed (int t, HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis) |
Frame synchronous beam search: proceed for 2nd frame and later. | |
void | get_back_trellis_end (HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis) |
Frame synchronous beam search: last frame. | |
void | get_back_trellis (HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis, LOGPROB *backmax) |
Frame synchronous beam search: the main. | |
LOGPROB | finalize_1st_pass (BACKTRELLIS *backtrellis, WORD_INFO *winfo, int len) |
Finalize the 1st pass. | |
LOGPROB | outprob_style (WCHMM_INFO *wchmm, int node, int last_wid, int t, HTK_Param *param) |
void | error_missing_right_triphone (HMM_Logical *base, char *rc_name) |
void | error_missing_left_triphone (HMM_Logical *base, char *lc_name) |
int | dfa_firstwords (NEXTWORD **nw, int peseqlen, int maxnw, DFA_INFO *dfa) |
int | dfa_nextwords (NODE *hypo, NEXTWORD **nw, int maxnw, DFA_INFO *dfa) |
boolean | dfa_acceptable (NODE *hypo, DFA_INFO *dfa) |
boolean | dfa_look_around (NEXTWORD *nword, NODE *hypo, BACKTRELLIS *bt) |
void | putsentence (NODE *hypo, int num) |
void | wchmm_fbs (HTK_Param *param, BACKTRELLIS *backtrellis, LOGPROB backmax, int stacksize, int ncan, int maxhypo, int cate_bgn, int cate_num) |
void | free_node (NODE *node) |
< Define if want triphone debug messages | |
NODE * | cpy_node (NODE *dst, NODE *src) |
NODE * | newnode () |
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) |
void | init_para (Value *para) |
HTK_Param * | new_wav2mfcc (SP16 speech[], int speechlen) |
void | put_header (FILE *stream) |
void | put_version (FILE *stream) |
void | put_compile_defs (FILE *stream) |
WCHMM_INFO * | wchmm_new () |
void | wchmm_free (WCHMM_INFO *w) |
void | print_wchmm_info (WCHMM_INFO *wchmm) |
void | build_wchmm2 (WCHMM_INFO *wchmm) |
void | wchmm_check_interactive (WCHMM_INFO *wchmm) |
void | check_wchmm (WCHMM_INFO *wchmm) |
void | RealTimeInit () |
void | RealTimePipeLinePrepare () |
int | RealTimePipeLine (SP16 *Speech, int len) |
Main function of on-the-fly 1st pass decoding. | |
int | RealTimeResume () |
HTK_Param * | RealTimeParam (LOGPROB *backmax) |
void | RealTimeCMNUpdate (HTK_Param *param) |
void | RealTimeTerminate () |
void | word_align (WORD_ID *words, short wnum, HTK_Param *param) |
void | phoneme_align (WORD_ID *words, short wnum, HTK_Param *param) |
void | state_align (WORD_ID *words, short wnum, HTK_Param *param) |
void | word_rev_align (WORD_ID *revwords, short wnum, HTK_Param *param) |
void | phoneme_rev_align (WORD_ID *revwords, short wnum, HTK_Param *param) |
void | state_rev_align (WORD_ID *revwords, short wnum, HTK_Param *param) |
void | check_specs () |
Check the user-specified parameters. | |
void | print_setting () |
void | print_info () |
int | adin_cut_callback_store_buffer (SP16 *now, int len) |
adin_go() callback to score each detected speech segment to buffer. | |
void | opt_terminate () |
void | usage () |
void | detailed_help () |
char * | filepath (char *filename, char *dirname) |
Change relative path to full path. | |
void | opt_parse (int argc, char *argv[], char *cwd) |
void | get_dirname (char *path) |
Get directory name from a path name of a file. | |
void | config_file_parse (char *conffile) |
void | checkpath (char *filename) |
int | set_beam_width (WCHMM_INFO *wchmm, int specified) |
Determine beam width on the 1st pass. | |
void | set_lm_weight () |
void | set_lm_weight2 () |
void | system_bootup () |
void | adin_initialize () |
void | final_fusion () |
Read in all models and prepare data for recognition. | |
void | setup_result_tty () |
void | ttyout_status_recready () |
void | ttyout_status_recstart () |
void | ttyout_status_recend () |
void | ttyout_status_param (HTK_Param *p) |
void | setup_result_msock () |
void | decode_output_selection (char *str) |
void | msock_status_recready () |
void | msock_status_recstart () |
void | msock_status_recend () |
void | msock_status_param (HTK_Param *p) |
void | hmm_check (HTK_HMM_INFO *hmminfo, WORD_INFO *winfo) |
void | record_sample_open () |
void | record_sample_write (SP16 *speech, int samplenum) |
void | record_sample_close () |
void | visual_init () |
void | visual_show (BACKTRELLIS *bt) |
void | visual2_init (int maxhypo) |
void | visual2_popped (NODE *n, int popctr) |
void | visual2_next_word (NODE *next, NODE *prev, int popctr) |
void | visual2_best (NODE *now, WORD_INFO *winfo) |
void | gmm_init (HTK_HMM_INFO *gmm, int prune_num) |
void | gmm_prepare (HTK_HMM_INFO *gmm) |
void | gmm_proceed (HTK_HMM_INFO *gmm, HTK_Param *param, int t) |
void | gmm_end (HTK_HMM_INFO *gmm) |
Finish the GMM computation for an input, and output the result. | |
void | msock_gmm () |
void | ttyout_gmm () |
boolean | gmm_valid_input () |
void | main_recognition_loop () |
Main recognition process loop. |
Definition in file extern.h.
|
Initialize backtrellis that will hold the whole word trellis (called once on startup).
Definition at line 74 of file backtrellis.c. Referenced by final_fusion(). |
|
Prepare backtrellis for the next input (called at beginning of each speech segment).
Definition at line 96 of file backtrellis.c. Referenced by get_back_trellis_init(). |
|
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.
Definition at line 144 of file backtrellis.c. Referenced by get_back_trellis_end(), and get_back_trellis_proceed(). |
|
Re-locate the stored atom lists per frame (will be called after the 1st pass).
Definition at line 170 of file backtrellis.c. Referenced by finalize_1st_pass(). |
|
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.
Definition at line 315 of file backtrellis.c. Referenced by main_recognition_loop(). |
|
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.
Definition at line 390 of file backtrellis.c. Referenced by finalize_1st_pass(). |
|
Search a word on the specified frame in a word trellis data.
Definition at line 428 of file backtrellis.c. Referenced by next_word(), ngram_firstwords(), print_1pass_result(), and start_word(). |
|
Make a list of word head nodes on which cross-word factoring cache is needed. On 1-gram factoring, the branch nodes on tree lexicon has a fixed factoring value (maximum 1-gram score of all sub-tree words). Thus, when computing cross-word factoring at word head nodes on inter-word transition, such 1-gram factoring nodes on word head, shared by several words, need not be cached in inter-word factoring cache. This function make a list of word-head nodes which requires inter-word factoring caching (i.e. isolated word head nodes, does not shared by other words) from the existing list of word head nodes, and set it to wchmm->start2isolate and wchmm->isolatenum.
Definition at line 715 of file factoring_sub.c. Referenced by build_wchmm2(). |
|
Main function to build whole successor list to lexicon tree.
Definition at line 360 of file factoring_sub.c. Referenced by build_wchmm2(). |
|
Frame synchronous beam search: the fist frame. This function will initialize nodes, tokens and the resulting word trellis for the 1st pass, and then compute for the 1st frame by setting the initial hypotheses. For later frames other than the first one, get_back_trellis_proceed() should be called instead.
Definition at line 1445 of file beam.c. Referenced by get_back_trellis(), RealTimeParam(), and RealTimePipeLine(). |
|
Frame synchronous beam search: proceed for 2nd frame and later. This is the main function of beam search on the 1st pass. Given a input vector of a frame, it proceeds the computation for the one frame, and store the words survived in the beam width to the word trellis structure. get_back_trellis_init() should be used for the first frame. For detailed procedure, please see the comments in this function.
Definition at line 1576 of file beam.c. Referenced by get_back_trellis(), get_back_trellis_end(), RealTimeParam(), and RealTimePipeLine(). |
|
Frame synchronous beam search: last frame. This function should be called at the end of the 1st pass. The last procedure will be done for the (param->samplenum - 1) frame.
Definition at line 2317 of file beam.c. Referenced by get_back_trellis(), RealTimeParam(), and RealTimeTerminate(). |
|
Frame synchronous beam search: the main. This function perform the 1st recognition pass of frame-synchronous beam search and output the result. It also stores all the word ends in every input frame to word trellis structure. This function will be called if the whole input vector is already given to the end. When online recognition, where the 1st pass will be processed in parallel with input, this function will not be used. In that case, functions defined in this file will be directly called from functions in realtime-1stpass.c.
Definition at line 2600 of file beam.c. Referenced by main_recognition_loop(). |
|
Finalize the 1st pass. This function will be called just after get_back_trellis_end() to finalize the 1st pass. It processes the resulting word trellis structure to be accessible from the 2nd pass, and output the best sentence hypothesis by backtracing the word trellis.
Definition at line 2399 of file beam.c. Referenced by get_back_trellis(), RealTimeParam(), and RealTimeTerminate(). |
|
Calculate output log probability of an input vector on time frame t in input paramter param at a node on tree lexicon.
Definition at line 383 of file outprob_style.c. Referenced by bt_discount_pescore(), get_back_trellis_proceed(), and init_nodescore(). |
|
Output error message when a triphone with the specified right context is not defined.
Definition at line 542 of file outprob_style.c. Referenced by next_word(), and scan_word(). |
|
Output error message when a triphone with the specified right context is not defined.
Definition at line 567 of file outprob_style.c. Referenced by outprob_style(), and scan_word(). |
|
Main function to perform stack decoding of the 2nd search pass.
Definition at line 1083 of file search_bestfirst_main.c. Referenced by main_recognition_loop(). |
|
< Define if want triphone debug messages Free a hypothesis node.
Definition at line 129 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(). |
|
Copy the content of node to another.
Definition at line 166 of file search_bestfirst_v1.c. Referenced by last_next_word(), and wchmm_fbs(). |
|
Allocate a new hypothesis node.
Definition at line 240 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
Allocate work area for trellis computation of a word. Definition at line 321 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
Free the work area for trellis computation of a word. Definition at line 359 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
Compute the forward viterbi for the last word to update forward scores and ready for word connection.
Definition at line 458 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
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.
Definition at line 1256 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
Generate an initial hypothesis from given word.
Definition at line 1544 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
Hypothesis termination: set the final sentence scores of hypothesis that has already reached to the end.
Definition at line 1650 of file search_bestfirst_v1.c. Referenced by wchmm_fbs(). |
|
Set configuration parameters for MFCC computation.
Definition at line 72 of file wav2mfcc.c. Referenced by new_wav2mfcc(), and RealTimeInit(). |
|
Extract MFCC parameters with sentence CMN from given waveform.
Definition at line 129 of file wav2mfcc.c. Referenced by main_recognition_loop(). |
|
Output application header.
Definition at line 48 of file version.c. Referenced by detailed_help(), opt_parse(), and print_info(). |
|
Output version information.
Definition at line 65 of file version.c. Referenced by usage(). |
|
Output compile-time settings.
Definition at line 89 of file version.c. Referenced by detailed_help(), opt_parse(), and print_info(). |
|
Allocate a new tree lexicon structure.
Definition at line 70 of file wchmm.c. Referenced by final_fusion(). |
|
Free all data in a tree lexicon.
|
|
Output some specifications of the tree lexicon (size etc.) to stdout.
Definition at line 1958 of file wchmm.c. Referenced by print_info(). |
|
Build a tree lexicon from given word dictionary and language model. This function does the same job as build_wchmm(), but it is much faster because finding of the longest matched word to an adding word is done by first sorting all the words in the dictoinary by their phoneme sequence order. This function will be used instead of build_wchmm() by default.
Definition at line 1682 of file wchmm.c. Referenced by final_fusion(). |
|
Command loop to browse and check the structure of the constructed tree lexicon on startup.
Definition at line 313 of file wchmm_check.c. Referenced by build_wchmm2(), and check_wchmm(). |
|
Check coherence of tree lexicon (for internal debug only!)
Definition at line 414 of file wchmm_check.c. Referenced by build_wchmm2(). |
|
Initializations for on-the-fly 1st pass decoding (will be called once on startup) Definition at line 211 of file realtime-1stpass.c. Referenced by final_fusion(). |
|
Data preparation for on-the-fly 1st pass decoding (will be called on the start of each sentence input) Definition at line 270 of file realtime-1stpass.c. Referenced by main_recognition_loop(). |
|
Main function of on-the-fly 1st pass decoding. This function will be called each time a new speech sample comes, as as callback from A/D-in routine. When a speech input begins, the captured speech will be passed to this function for every sample segments. This process will continue until A/D-in routine detects an end of speech or input stream reached to an end. This function will perform feture vector extraction and beam decording as 1st pass recognition simultaneously, in frame-wise mannar.
Definition at line 352 of file realtime-1stpass.c. Referenced by main_recognition_loop(). |
|
Finalize the 1st pass on-the-fly decoding.
Definition at line 700 of file realtime-1stpass.c. Referenced by main_recognition_loop(). |
|
Update cepstral mean of CMN to prepare for the next input.
Definition at line 850 of file realtime-1stpass.c. Referenced by main_recognition_loop(). |
|
Finalize the 1st pass on-the-fly decoding when terminated. Definition at line 898 of file realtime-1stpass.c. Referenced by main_recognition_loop(). |
|
Do forced alignment per word for the given word sequence.
Definition at line 381 of file word_align.c. |
|
Do forced alignment per phoneme for the given word sequence.
Definition at line 430 of file word_align.c. |
|
Do forced alignment per HMM state for the given word sequence.
Definition at line 479 of file word_align.c. |
|
Do forced alignment per word for the given word sequence (reversed order).
Definition at line 403 of file word_align.c. Referenced by result_reorder_and_output(), and wchmm_fbs(). |
|
Do forced alignment per phoneme for the given word sequence (reversed order).
Definition at line 452 of file word_align.c. Referenced by result_reorder_and_output(), and wchmm_fbs(). |
|
Do forced alignment per state for the given word sequence (reversed order).
Definition at line 501 of file word_align.c. Referenced by result_reorder_and_output(), and wchmm_fbs(). |
|
Check the user-specified parameters. This functions checks whether the specified files actually exist, and also the mutual coherence of the parameters and their correspondence with used model is also checked. If a serious error is found, it produces error and exits. Definition at line 87 of file m_chkparam.c. Referenced by main(). |
|
Output all file names of the models. Definition at line 37 of file m_info.c. Referenced by print_info(). |
|
Output full system information. Definition at line 88 of file m_info.c. Referenced by main_recognition_loop(). |
|
adin_go() callback to score each detected speech segment to buffer. This function records the incomping speech segments detected in adin_go() to a buffer speech. This function will be used when recognition runs in buffered mode (= non-realtime mode).
Definition at line 103 of file main.c. Referenced by main_recognition_loop(), and RealTimePipeLine(). |
|
Output error message and error exit (for option parse error) Definition at line 37 of file m_usage.c. Referenced by args_needed_exit(), and opt_parse(). |
|
Output version messages and exit (for exec with no option) Definition at line 53 of file m_usage.c. Referenced by opt_parse(). |
|
Output version info, engine setting and detailed help for options, and exit. Definition at line 72 of file m_usage.c. Referenced by opt_parse(). |
|
Change relative path to full path. If the file path is given as relative, prepend the dirname to it. If the file path is full, just copy it to new buffer and return.
Definition at line 51 of file m_options.c. Referenced by opt_parse(). |
|
Parse options and set values.
Definition at line 109 of file m_options.c. Referenced by config_file_parse(), and main(). |
|
Get directory name from a path name of a file. The trailing slash will be left, and the given buffer will be modified.
Definition at line 127 of file m_jconf.c. Referenced by config_file_parse(). |
|
Read and parse a jconf file, and set the specified option values.
Definition at line 159 of file m_jconf.c. Referenced by opt_parse(). |
|
Check if a file actually exist and is readable.
Definition at line 39 of file m_chkparam.c. Referenced by check_specs(). |
|
Determine beam width on the 1st pass.
Definition at line 283 of file m_chkparam.c. Referenced by final_fusion(). |
|
Set default values of LM weight and word insertion penalty on the 1st pass depending on the acoustic model type. Definition at line 318 of file m_chkparam.c. Referenced by configure_param(). |
|
Set default values of LM weight and word insertion penalty on the 2nd pass depending on the acoustic model type. Definition at line 342 of file m_chkparam.c. Referenced by configure_param(). |
|
Function to be called at the first stage on system bootup. It will setup memory allocation functions and register error handling functions. Definition at line 95 of file m_bootup.c. Referenced by main(). |
|
Initialize audio input device specified by speech_input, and set parameters for sampling rate and speech detection parameters. Definition at line 39 of file m_adin.c. Referenced by main_recognition_loop(). |
|
Read in all models and prepare data for recognition. This function reads in all the models needed for recognition, inspects the models and their relations, builds a tree lexicon, and allocate cache. Some default parameters will also be set here. Definition at line 338 of file m_fusion.c. Referenced by main_recognition_loop(). |
|
Register output functions to enable module output. Definition at line 650 of file result_tty.c. Referenced by select_result_output(). |
|
Output when ready to recognize and start waiting speech input. Definition at line 579 of file result_tty.c. Referenced by setup_result_tty(). |
|
Output when input starts. Definition at line 597 of file result_tty.c. Referenced by setup_result_tty(). |
|
Output when input ends. Definition at line 612 of file result_tty.c. Referenced by setup_result_tty(). |
|
Output input parameter status such as length.
Definition at line 629 of file result_tty.c. Referenced by setup_result_tty(). |
|
Register output functions to enable module output. Definition at line 586 of file result_msock.c. Referenced by select_result_output(). |
|
Setup which word information to be output as a recognition result.
Definition at line 84 of file result_msock.c. Referenced by opt_parse(). |
|
Output when ready to recognize and start waiting speech input. Definition at line 520 of file result_msock.c. Referenced by setup_result_msock(). |
|
Output when input starts. Definition at line 535 of file result_msock.c. Referenced by setup_result_msock(). |
|
Output when input ends. Definition at line 550 of file result_msock.c. Referenced by setup_result_msock(). |
|
Output input parameter status such as length.
Definition at line 567 of file result_msock.c. Referenced by setup_result_msock(). |
|
Mode to do interactive triphone conversion check ("-check hmm").
Definition at line 289 of file hmm_check.c. Referenced by initialize_dict(). |
|
Open temporary file for starting recording. Definition at line 146 of file record.c. Referenced by main_recognition_loop(), and RealTimePipeLinePrepare(). |
|
Append speech segment to file previously opened by record_sample_open().
Definition at line 175 of file record.c. Referenced by adin_cut_callback_store_buffer(), and RealTimePipeLine(). |
|
End recording. Close the current temporary recording file, and rename the temporary file to the final time-stamp file name. Definition at line 207 of file record.c. Referenced by main_recognition_loop(). |
|
Initialization for computing GMM likelihoods. This will be called once on startup.
Definition at line 397 of file gmm.c. Referenced by initialize_GMM(). |
|
Prepare for the next GMM computation. This will be called just before an input begins.
Definition at line 436 of file gmm.c. Referenced by get_back_trellis_init(). |
|
Compute output probabilities of all GMM for a given input vector, and accumulate the results to the gmm_score buffer.
Definition at line 469 of file gmm.c. Referenced by get_back_trellis_proceed(). |
|
Finish the GMM computation for an input, and output the result. The GMM of the maximum score is finally determined from the accumulated scores computed by gmm_proceed(), and compute the confidence score of the maximum GMM using posterior probability. Then the result will be output using result_gmm().
Definition at line 512 of file gmm.c. Referenced by finalize_1st_pass(). |
|
Send the result of GMM computation to module client. (for "-result msock" option) Definition at line 622 of file gmm.c. Referenced by setup_result_msock(). |
|
Output result of GMM computation to standard out. (for "-result tty" option) Definition at line 584 of file gmm.c. Referenced by setup_result_tty(). |
|
Return whether the last input was valid or invalid, from the result of GMM computation.
Definition at line 562 of file gmm.c. Referenced by main_recognition_loop(), and RealTimeCMNUpdate(). |
|
Main recognition process loop. This function is a main loop to execute recognition. First the whole recognition system is setup, and then it enters a main event loop. If the start of speech input is detected, the recognition process of the first pass and second pass will be performed in turn, and the result will be output, and return to the event loop. In module mode, the module commands from module client will also be received and processed here. Main Recognition Loop Definition at line 253 of file main.c. Referenced by main(), and main_module_loop(). |