Julius 4.2
|
00001 00018 /* 00019 * Copyright (c) 1991-2011 Kawahara Lab., Kyoto University 00020 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00021 * Copyright (c) 2005-2011 Julius project team, Nagoya Institute of Technology 00022 * All rights reserved 00023 */ 00024 00025 #include <julius/julius.h> 00026 00041 void 00042 print_jconf_overview(Jconf *jconf) 00043 { 00044 JCONF_AM *amconf; 00045 JCONF_LM *lmconf; 00046 JCONF_SEARCH *sconf; 00047 GRAMLIST *g; 00048 int i, n; 00049 00050 jlog("------------------------------------------------------------\n"); 00051 jlog("Configuration of Modules\n\n"); 00052 jlog(" Number of defined modules:"); 00053 i = 0; for(amconf=jconf->am_root;amconf;amconf=amconf->next) i++; 00054 jlog(" AM=%d,", i); 00055 i = 0; for(lmconf=jconf->lm_root;lmconf;lmconf=lmconf->next) i++; 00056 jlog(" LM=%d,", i); 00057 i = 0; for(sconf=jconf->search_root;sconf;sconf=sconf->next) i++; 00058 jlog(" SR=%d\n", i); 00059 00060 jlog("\n"); 00061 00062 jlog(" Acoustic Model (with input parameter spec.):\n"); 00063 for(amconf=jconf->am_root;amconf;amconf=amconf->next) { 00064 if (amconf->name[0] != '\0') { 00065 jlog(" - AM%02d \"%s\"\n", amconf->id, amconf->name); 00066 } else { 00067 jlog(" - AM%02d\n", amconf->id); 00068 } 00069 jlog("\thmmfilename=%s\n",amconf->hmmfilename); 00070 if (amconf->mapfilename != NULL) { 00071 jlog("\thmmmapfilename=%s\n",amconf->mapfilename); 00072 } 00073 if (amconf->hmm_gs_filename != NULL) { 00074 jlog("\thmmfile for Gaussian Selection: %s\n", amconf->hmm_gs_filename); 00075 } 00076 } 00077 jlog("\n"); 00078 00079 jlog(" Language Model:\n"); 00080 for(lmconf=jconf->lm_root;lmconf;lmconf=lmconf->next) { 00081 if (lmconf->name[0] != '\0') { 00082 jlog(" - LM%02d \"%s\"\n", lmconf->id, lmconf->name); 00083 } else { 00084 jlog(" - LM%02d\n", lmconf->id); 00085 } 00086 if (lmconf->lmtype == LM_PROB) { 00087 jlog("\tvocabulary filename=%s\n",lmconf->dictfilename); 00088 if (lmconf->ngram_filename != NULL) { 00089 jlog("\tn-gram filename=%s (binary format)\n", lmconf->ngram_filename); 00090 } else { 00091 if (lmconf->ngram_filename_rl_arpa != NULL) { 00092 jlog("\tbackward n-gram filename=%s\n", lmconf->ngram_filename_rl_arpa); 00093 if (lmconf->ngram_filename_lr_arpa != NULL) { 00094 jlog("\tforward 2-gram for pass1=%s\n", lmconf->ngram_filename_lr_arpa); 00095 } 00096 } else if (lmconf->ngram_filename_lr_arpa != NULL) { 00097 jlog("\tforward n-gram filename=%s\n", lmconf->ngram_filename_lr_arpa); 00098 } 00099 } 00100 } 00101 if (lmconf->lmtype == LM_DFA) { 00102 switch(lmconf->lmvar) { 00103 case LM_DFA_GRAMMAR: 00104 n = 1; 00105 for(g = lmconf->gramlist_root; g; g = g->next) { 00106 jlog("\tgrammar #%d:\n", n++); 00107 jlog("\t dfa = %s\n", g->dfafile); 00108 jlog("\t dict = %s\n", g->dictfile); 00109 } 00110 break; 00111 case LM_DFA_WORD: 00112 n = 1; 00113 for(g = lmconf->wordlist_root; g; g = g->next) { 00114 jlog("\twordlist #%d: %s\n", n++, g->dictfile); 00115 } 00116 break; 00117 } 00118 } 00119 } 00120 jlog("\n"); 00121 jlog(" Recognizer:\n"); 00122 for(sconf=jconf->search_root; sconf; sconf=sconf->next) { 00123 if (sconf->name[0] != '\0') { 00124 jlog(" - SR%02d \"%s\"", sconf->id, sconf->name); 00125 } else { 00126 jlog(" - SR%02d", sconf->id); 00127 } 00128 jlog(" (AM%02d, LM%02d)\n", sconf->amconf->id, sconf->lmconf->id); 00129 } 00130 jlog("\n"); 00131 } 00132 00133 00134 00148 void 00149 print_engine_info(Recog *recog) 00150 { 00151 FILE *fp; 00152 Jconf *jconf; 00153 MFCCCalc *mfcc; 00154 PROCESS_AM *am; 00155 PROCESS_LM *lm; 00156 RecogProcess *r; 00157 00158 jconf = recog->jconf; 00159 00160 /* set output file pointer to fp */ 00161 fp = jlog_get_fp(); 00162 if (fp == NULL) return; 00163 00164 jlog("----------------------- System Information begin ---------------------\n"); 00165 j_put_header(fp); 00166 j_put_compile_defs(fp); 00167 jlog("\n"); 00168 00169 /* print current argument setting to log */ 00170 print_jconf_overview(jconf); 00171 00172 if (jconf->input.type == INPUT_WAVEFORM) { 00173 00174 /* acoustic parameter conditions for this model */ 00175 jlog("------------------------------------------------------------\n"); 00176 jlog("Speech Analysis Module(s)\n\n"); 00177 00178 for(mfcc=recog->mfcclist;mfcc;mfcc=mfcc->next) { 00179 00180 jlog("[MFCC%02d] for", mfcc->id); 00181 for(am=recog->amlist;am;am=am->next) { 00182 if (am->mfcc == mfcc) { 00183 jlog(" [AM%02d %s]", am->config->id, am->config->name); 00184 } 00185 } 00186 if (recog->gmm != NULL) { 00187 if (recog->gmmmfcc == mfcc) { 00188 jlog(" [GMM]"); 00189 } 00190 } 00191 jlog("\n\n"); 00192 00193 put_para(fp, mfcc->para); 00194 00195 if (jconf->input.type == INPUT_WAVEFORM) { 00196 jlog(" spectral subtraction = "); 00197 if (mfcc->frontend.ssload_filename || mfcc->frontend.sscalc) { 00198 if (mfcc->frontend.sscalc) { 00199 jlog("use head silence of each input\n"); 00200 jlog("\t head sil length = %d msec\n", mfcc->frontend.sscalc_len); 00201 } else { /* ssload_filename != NULL */ 00202 jlog("use a constant value from file\n"); 00203 jlog(" noise spectrum file = \"%s\"\n", mfcc->frontend.ssload_filename); 00204 } 00205 jlog("\t alpha coef. = %f\n", mfcc->frontend.ss_alpha); 00206 jlog("\t spectral floor = %f\n", mfcc->frontend.ss_floor); 00207 } else { 00208 jlog("off\n"); 00209 } 00210 } 00211 jlog(" cepstral normalization = "); 00212 if (mfcc->para->cmn || mfcc->para->cvn) { 00213 if (jconf->decodeopt.realtime_flag) { 00214 jlog("real-time MAP-"); 00215 } else { 00216 jlog("sentence "); 00217 } 00218 if (mfcc->para->cmn) { 00219 jlog("CMN"); 00220 } 00221 if (mfcc->para->cmn && mfcc->para->cvn) { 00222 jlog("+"); 00223 } 00224 if (mfcc->para->cvn) { 00225 jlog("CVN"); 00226 } 00227 jlog("\n"); 00228 } else { 00229 jlog("no\n"); 00230 } 00231 jlog("\t base setup from ="); 00232 if (mfcc->htk_loaded == 1 || mfcc->hmm_loaded == 1) { 00233 if (mfcc->hmm_loaded == 1) { 00234 jlog(" binhmm-embedded"); 00235 if (mfcc->htk_loaded == 1) { 00236 jlog(", then overridden by HTK Config and defaults"); 00237 } 00238 } else { 00239 if (mfcc->htk_loaded == 1) { 00240 jlog(" HTK Config (and HTK defaults)"); 00241 } 00242 } 00243 } else { 00244 jlog(" Julius defaults"); 00245 } 00246 jlog("\n"); 00247 00248 jlog("\n"); 00249 00250 if (jconf->decodeopt.realtime_flag && (mfcc->para->cmn || mfcc->para->cvn)) { 00251 jlog(" MAP-"); 00252 if (mfcc->para->cmn) jlog("CMN"); 00253 if (mfcc->para->cmn && mfcc->para->cvn) jlog("+"); 00254 if (mfcc->para->cvn) jlog("CVN"); 00255 jlog(":\n"); 00256 jlog(" initial cep. data = "); 00257 if (mfcc->cmn.load_filename) { 00258 jlog("load from \"%s\"\n", mfcc->cmn.load_filename); 00259 } else { 00260 jlog("none\n"); 00261 } 00262 jlog(" beginning data weight = %6.2f\n", mfcc->cmn.map_weight); 00263 if (mfcc->cmn.update) { 00264 jlog(" beginning data update = yes, from last inputs at each input\n"); 00265 } else { 00266 jlog(" beginning data update = no, use default as initial at each input\n"); 00267 } 00268 if (mfcc->cmn.save_filename) { 00269 jlog(" save cep. data to = file \"%s\" at end of each input\n", mfcc->cmn.save_filename); 00270 } 00271 jlog("\n"); 00272 } 00273 } 00274 } 00275 00276 00277 if (recog->gmm != NULL) { 00278 jlog("------------------------------------------------------------\n"); 00279 jlog("GMM\n"); 00280 jlog("\n"); 00281 jlog(" GMM definition file = %s\n", jconf->reject.gmm_filename); 00282 jlog(" GMM gprune num = %d\n", jconf->reject.gmm_gprune_num); 00283 if (jconf->reject.gmm_reject_cmn_string != NULL) { 00284 jlog(" GMM names to reject = %s\n", jconf->reject.gmm_reject_cmn_string); 00285 } 00286 #ifdef GMM_VAD 00287 jlog("\n GMM-based VAD\n\n"); 00288 jlog(" backstep on trigger = %d frames\n", jconf->detect.gmm_margin); 00289 jlog(" up-trigger thres score = %.1f\n", jconf->detect.gmm_uptrigger_thres); 00290 jlog(" down-trigger thres score = %.1f\n", jconf->detect.gmm_downtrigger_thres); 00291 #endif 00292 jlog("\n GMM"); 00293 print_hmmdef_info(fp, recog->gmm); 00294 jlog("\n"); 00295 } 00296 00297 jlog("------------------------------------------------------------\n"); 00298 jlog("Acoustic Model(s)\n"); 00299 jlog("\n"); 00300 00301 for(am = recog->amlist; am; am = am->next) { 00302 if (am->config->name[0] != '\0') { 00303 jlog("[AM%02d \"%s\"]\n\n", am->config->id, am->config->name); 00304 } else { 00305 jlog("[AM%02d]\n\n", am->config->id); 00306 } 00307 print_hmmdef_info(fp, am->hmminfo); 00308 jlog("\n"); 00309 if (am->config->hmm_gs_filename != NULL) { 00310 jlog("GS "); 00311 print_hmmdef_info(fp, am->hmm_gs); 00312 jlog("\n"); 00313 } 00314 00315 jlog(" AM Parameters:\n"); 00316 00317 jlog(" Gaussian pruning = "); 00318 switch(am->config->gprune_method){ 00319 case GPRUNE_SEL_NONE: jlog("none (full computation)"); break; 00320 case GPRUNE_SEL_BEAM: jlog("beam"); break; 00321 case GPRUNE_SEL_HEURISTIC: jlog("heuristic"); break; 00322 case GPRUNE_SEL_SAFE: jlog("safe"); break; 00323 case GPRUNE_SEL_USER: jlog("(use plugin function)"); break; 00324 } 00325 jlog(" (-gprune)\n"); 00326 if (am->config->gprune_method != GPRUNE_SEL_NONE 00327 && am->config->gprune_method != GPRUNE_SEL_USER) { 00328 jlog(" top N mixtures to calc = %d / %d (-tmix)\n", am->config->mixnum_thres, am->hmminfo->maxcodebooksize); 00329 } 00330 if (am->config->hmm_gs_filename != NULL) { 00331 jlog(" GS state num thres = %d / %d selected (-gsnum)\n", am->config->gs_statenum, am->hmm_gs->totalstatenum); 00332 } 00333 jlog(" short pause HMM name = \"%s\" specified", am->config->spmodel_name); 00334 if (am->hmminfo->sp != NULL) { 00335 jlog(", \"%s\" applied", am->hmminfo->sp->name); 00336 if (am->hmminfo->sp->is_pseudo) { 00337 jlog(" (pseudo)"); 00338 } else { 00339 jlog(" (physical)"); 00340 } 00341 } else { 00342 jlog(" but not assigned"); 00343 } 00344 jlog(" (-sp)\n"); 00345 jlog(" cross-word CD on pass1 = "); 00346 #ifdef PASS1_IWCD 00347 jlog("handle by approx. "); 00348 switch(am->hmminfo->cdset_method) { 00349 case IWCD_AVG: 00350 jlog("(use average prob. of same LC)\n"); 00351 break; 00352 case IWCD_MAX: 00353 jlog("(use max. prob. of same LC)\n"); 00354 break; 00355 case IWCD_NBEST: 00356 jlog("(use %d-best of same LC)\n", am->hmminfo->cdmax_num); 00357 break; 00358 } 00359 #else 00360 jlog("disabled\n"); 00361 #endif 00362 00363 if (am->hmminfo->multipath) { 00364 jlog(" sp transition penalty = %+2.1f\n", am->config->iwsp_penalty); 00365 } 00366 00367 jlog("\n"); 00368 } 00369 00370 jlog("------------------------------------------------------------\n"); 00371 jlog("Language Model(s)\n"); 00372 00373 for(lm = recog->lmlist; lm; lm = lm->next) { 00374 jlog("\n"); 00375 if (lm->config->name[0] != '\0') { 00376 jlog("[LM%02d \"%s\"]", lm->config->id, lm->config->name); 00377 } else { 00378 jlog("[LM%02d]", lm->config->id); 00379 } 00380 if (lm->lmtype == LM_PROB) { 00381 if (lm->lmvar == LM_NGRAM) { 00382 jlog(" type=n-gram\n\n"); 00383 if (lm->ngram) { 00384 print_ngram_info(fp, lm->ngram); jlog("\n"); 00385 } 00386 } else if (lm->lmvar == LM_NGRAM_USER) { 00387 if (lm->ngram) { 00388 jlog(" type=n-gram + user\n\n"); 00389 print_ngram_info(fp, lm->ngram); jlog("\n"); 00390 } else { 00391 jlog(" type=user\n\n"); 00392 } 00393 } else { 00394 jlog(" type=UNKNOWN??\n\n"); 00395 } 00396 } else if (lm->lmtype == LM_DFA) { 00397 if (lm->lmvar == LM_DFA_GRAMMAR) { 00398 jlog(" type=grammar\n\n"); 00399 if (lm->dfa) { 00400 print_dfa_info(fp, lm->dfa); jlog("\n"); 00401 if (debug2_flag) { 00402 print_dfa_cp(fp, lm->dfa); 00403 jlog("\n"); 00404 } 00405 } 00406 } else if (lm->lmvar == LM_DFA_WORD) { 00407 jlog(" type=word\n\n"); 00408 } else { 00409 jlog(" type=UNKNOWN??\n\n"); 00410 } 00411 } else { 00412 jlog(" type=UNKNOWN??\n\n"); 00413 } 00414 if (lm->winfo != NULL) { 00415 print_voca_info(fp, lm->winfo); jlog("\n"); 00416 } 00417 00418 jlog(" Parameters:\n"); 00419 00420 if (lm->lmtype == LM_DFA && lm->lmvar == LM_DFA_GRAMMAR) { 00421 if (lm->dfa != NULL) { 00422 int i; 00423 jlog(" found sp category IDs ="); 00424 for(i=0;i<lm->dfa->term_num;i++) { 00425 if (lm->dfa->is_sp[i]) { 00426 jlog(" %d", i); 00427 } 00428 } 00429 jlog("\n"); 00430 } 00431 } 00432 00433 if (lm->lmtype == LM_PROB) { 00434 if (lm->config->enable_iwspword) { 00435 jlog("\tIW-sp word added to dict= \"%s\"\n", lm->config->iwspentry); 00436 } 00437 if (lm->config->additional_dict_files) { 00438 JCONF_LM_NAMELIST *nl; 00439 jlog("\tadditional dictionaries:\n"); 00440 for(nl=lm->config->additional_dict_files;nl;nl=nl->next) { 00441 jlog("\t\t\t%s\n", nl->name); 00442 } 00443 jlog("\n"); 00444 } 00445 if (lm->config->additional_dict_entries) { 00446 JCONF_LM_NAMELIST *nl; 00447 int n = 0; 00448 jlog("\tadditional dict entries:\n"); 00449 for(nl=lm->config->additional_dict_entries;nl;nl=nl->next) { 00450 jlog("\t\t\t%s\n", nl->name); 00451 n++; 00452 } 00453 jlog("--- total %d entries\n", n); 00454 } 00455 } 00456 00457 if (lm->lmtype == LM_PROB) { 00458 jlog("\t(-silhead)head sil word = "); 00459 put_voca(fp, lm->winfo, lm->winfo->head_silwid); 00460 jlog("\t(-siltail)tail sil word = "); 00461 put_voca(fp, lm->winfo, lm->winfo->tail_silwid); 00462 } 00463 00464 if (lm->lmvar == LM_DFA_WORD) { 00465 jlog(" silence model names to add at word head / tail: (-wsil)\n"); 00466 jlog("\tword head = \"%s\"\n", lm->config->wordrecog_head_silence_model_name); 00467 jlog("\tword tail = \"%s\"\n", lm->config->wordrecog_tail_silence_model_name); 00468 jlog("\ttheir context name = \"%s\"\n", (lm->config->wordrecog_silence_context_name[0] == '\0') ? "NULL (blank)" : lm->config->wordrecog_silence_context_name); 00469 00470 } 00471 00472 } 00473 00474 jlog("\n"); 00475 jlog("------------------------------------------------------------\n"); 00476 jlog("Recognizer(s)\n\n"); 00477 00478 for(r = recog->process_list; r; r = r->next) { 00479 jlog("[SR%02d", r->config->id); 00480 if (r->config->name[0] != '\0') { 00481 jlog(" \"%s\"", r->config->name); 00482 } 00483 jlog("] "); 00484 if (r->am->config->name[0] != '\0') { 00485 jlog("AM%02d \"%s\"", r->am->config->id, r->am->config->name); 00486 } else { 00487 jlog("AM%02d", r->am->config->id); 00488 } 00489 jlog(" + "); 00490 if (r->lm->config->name[0] != '\0') { 00491 jlog("LM%02d \"%s\"", r->lm->config->id, r->lm->config->name); 00492 } else { 00493 jlog("LM%02d", r->lm->config->id); 00494 } 00495 jlog("\n\n"); 00496 00497 if (r->wchmm != NULL) { 00498 print_wchmm_info(r->wchmm); jlog("\n"); 00499 } 00500 if (r->lmtype == LM_PROB) { 00501 jlog(" Inter-word N-gram cache: \n"); 00502 { 00503 int num, len; 00504 #ifdef UNIGRAM_FACTORING 00505 len = r->wchmm->isolatenum; 00506 jlog("\troot node to be cached = %d / %d (isolated only)\n", 00507 len, r->wchmm->startnum); 00508 #else 00509 len = r->wchmm->startnum; 00510 jlog("\troot node to be cached = %d (all)\n", len); 00511 #endif 00512 #ifdef HASH_CACHE_IW 00513 num = (r->config->pass1.iw_cache_rate * r->lm->ngram->max_word_num) / 100; 00514 jlog("\tword ends to be cached = %d / %d\n", num, r->lm->ngram->max_word_num); 00515 #else 00516 num = r->lm->ngram->max_word_num; 00517 jlog("\tword ends to be cached = %d (all)\n", num); 00518 #endif 00519 jlog("\t max. allocation size = %dMB\n", num * len / 1000 * sizeof(LOGPROB) / 1000); 00520 } 00521 } 00522 00523 if (r->lmtype == LM_PROB) { 00524 jlog("\t(-lmp) pass1 LM weight = %2.1f ins. penalty = %+2.1f\n", r->config->lmp.lm_weight, r->config->lmp.lm_penalty); 00525 jlog("\t(-lmp2) pass2 LM weight = %2.1f ins. penalty = %+2.1f\n", r->config->lmp.lm_weight2, r->config->lmp.lm_penalty2); 00526 jlog("\t(-transp)trans. penalty = %+2.1f per word\n", r->config->lmp.lm_penalty_trans); 00527 } else if (r->lmtype == LM_DFA && r->lmvar == LM_DFA_GRAMMAR) { 00528 jlog("\t(-penalty1) IW penalty1 = %+2.1f\n", r->config->lmp.penalty1); 00529 jlog("\t(-penalty2) IW penalty2 = %+2.1f\n", r->config->lmp.penalty2); 00530 } 00531 00532 00533 #ifdef CONFIDENCE_MEASURE 00534 #ifdef CM_MULTIPLE_ALPHA 00535 jlog("\t(-cmalpha)CM alpha coef = from %f to %f by step of %f (%d outputs)\n", r->config->annotate.cm_alpha_bgn, r->config->annotate.cm_alpha_end, r->config->annotate.cm_alpha_step, r->config->annotate.cm_alpha_num); 00536 #else 00537 jlog("\t(-cmalpha)CM alpha coef = %f\n", r->config->annotate.cm_alpha); 00538 #endif 00539 #ifdef CM_SEARCH_LIMIT 00540 jlog("\t(-cmthres) CM cut thres = %f for hypo generation\n", r->config->annotate.cm_cut_thres); 00541 #endif 00542 #ifdef CM_SEARCH_LIMIT_POP 00543 jlog("\t(-cmthres2)CM cut thres = %f for popped hypo\n", r->config->annotate.cm_cut_thres_pop); 00544 #endif 00545 #endif /* CONFIDENCE_MEASURE */ 00546 jlog("\n"); 00547 00548 if (r->am->hmminfo->multipath) { 00549 if (r->lm->config->enable_iwsp) { 00550 jlog("\t inter-word short pause = on (append \"%s\" for each word tail)\n", r->am->hmminfo->sp->name); 00551 jlog("\t sp transition penalty = %+2.1f\n", r->am->config->iwsp_penalty); 00552 } 00553 } 00554 00555 if (r->lmvar == LM_DFA_WORD) { 00556 #ifdef DETERMINE 00557 jlog(" early word determination: (-wed)\n"); 00558 jlog("\tscore threshold = %f\n", r->config->pass1.determine_score_thres); 00559 jlog("\tframe dur. thres = %d\n", r->config->pass1.determine_duration_thres); 00560 #endif 00561 } 00562 00563 jlog(" Search parameters: \n"); 00564 jlog("\t multi-path handling = "); 00565 if (r->am->hmminfo->multipath) { 00566 jlog("yes, multi-path mode enabled\n"); 00567 } else { 00568 jlog("no\n"); 00569 } 00570 jlog("\t(-b) trellis beam width = %d", r->trellis_beam_width); 00571 if (r->config->pass1.specified_trellis_beam_width == -1) { 00572 jlog(" (-1 or not specified - guessed)\n"); 00573 } else if (r->config->pass1.specified_trellis_beam_width == 0) { 00574 jlog(" (0 - full)\n"); 00575 } else { 00576 jlog("\n"); 00577 } 00578 #ifdef SCORE_PRUNING 00579 if (r->config->pass1.score_pruning_width < 0.0) { 00580 jlog("\t(-bs)score pruning thres= disabled\n"); 00581 } else { 00582 jlog("\t(-bs)score pruning thres= %f\n", r->config->pass1.score_pruning_width); 00583 } 00584 #endif 00585 jlog("\t(-n)search candidate num= %d\n", r->config->pass2.nbest); 00586 jlog("\t(-s) search stack size = %d\n", r->config->pass2.stack_size); 00587 jlog("\t(-m) search overflow = after %d hypothesis poped\n", r->config->pass2.hypo_overflow); 00588 jlog("\t 2nd pass method = "); 00589 if (r->config->graph.enabled) { 00590 #ifdef GRAPHOUT_DYNAMIC 00591 #ifdef GRAPHOUT_SEARCH 00592 jlog("searching graph, generating dynamic graph\n"); 00593 #else 00594 jlog("searching sentence, generating dynamic graph\n"); 00595 #endif /* GRAPHOUT_SEARCH */ 00596 #else /* ~GRAPHOUT_DYNAMIC */ 00597 jlog("searching sentence, generating static graph from N-best\n"); 00598 #endif 00599 } else { 00600 jlog("searching sentence, generating N-best\n"); 00601 } 00602 if (r->config->pass2.enveloped_bestfirst_width >= 0) { 00603 jlog("\t(-b2) pass2 beam width = %d\n", r->config->pass2.enveloped_bestfirst_width); 00604 } 00605 jlog("\t(-lookuprange)lookup range= %d (tm-%d <= t <tm+%d)\n",r->config->pass2.lookup_range,r->config->pass2.lookup_range,r->config->pass2.lookup_range); 00606 #ifdef SCAN_BEAM 00607 jlog("\t(-sb)2nd scan beamthres = %.1f (in logscore)\n", r->config->pass2.scan_beam_thres); 00608 #endif 00609 jlog("\t(-n) search till = %d candidates found\n", r->config->pass2.nbest); 00610 jlog("\t(-output) and output = %d candidates out of above\n", r->config->output.output_hypo_maxnum); 00611 00612 if (r->ccd_flag) { 00613 jlog("\t IWCD handling:\n"); 00614 #ifdef PASS1_IWCD 00615 jlog("\t 1st pass: approximation "); 00616 switch(r->am->hmminfo->cdset_method) { 00617 case IWCD_AVG: 00618 jlog("(use average prob. of same LC)\n"); 00619 break; 00620 case IWCD_MAX: 00621 jlog("(use max. prob. of same LC)\n"); 00622 break; 00623 case IWCD_NBEST: 00624 jlog("(use %d-best of same LC)\n", r->am->hmminfo->cdmax_num); 00625 break; 00626 } 00627 #else 00628 jlog("\t 1st pass: ignored\n"); 00629 #endif 00630 #ifdef PASS2_STRICT_IWCD 00631 jlog("\t 2nd pass: strict (apply when expanding hypo. )\n"); 00632 #else 00633 jlog("\t 2nd pass: loose (apply when hypo. is popped and scanned)\n"); 00634 #endif 00635 } 00636 if (r->lmtype == LM_PROB) { 00637 jlog("\t factoring score: "); 00638 #ifdef UNIGRAM_FACTORING 00639 jlog("1-gram prob. (statically assigned beforehand)\n"); 00640 #else 00641 jlog("2-gram prob. (dynamically computed while search)\n"); 00642 #endif 00643 } 00644 00645 if (r->config->annotate.align_result_word_flag) { 00646 jlog("\t output word alignments\n"); 00647 } 00648 if (r->config->annotate.align_result_phoneme_flag) { 00649 jlog("\t output phoneme alignments\n"); 00650 } 00651 if (r->config->annotate.align_result_state_flag) { 00652 jlog("\t output state alignments\n"); 00653 } 00654 if (r->lmtype == LM_DFA && r->lmvar == LM_DFA_GRAMMAR) { 00655 if (r->config->pass2.looktrellis_flag) { 00656 jlog("\t only words in backtrellis will be expanded in 2nd pass\n"); 00657 } else { 00658 jlog("\t all possible words will be expanded in 2nd pass\n"); 00659 } 00660 } 00661 if (r->wchmm != NULL) { 00662 if (r->wchmm->category_tree) { 00663 if (r->config->pass1.old_tree_function_flag) { 00664 jlog("\t build_wchmm() used\n"); 00665 } else { 00666 jlog("\t build_wchmm2() used\n"); 00667 } 00668 #ifdef PASS1_IWCD 00669 #ifdef USE_OLD_IWCD 00670 jlog("\t full lcdset used\n"); 00671 #else 00672 jlog("\t lcdset limited by word-pair constraint\n"); 00673 #endif 00674 #endif /* PASS1_IWCD */ 00675 } 00676 } 00677 if (r->config->output.progout_flag) { 00678 jlog("\tprogressive output on 1st pass\n"); 00679 } 00680 if (r->config->compute_only_1pass) { 00681 jlog("\tCompute only 1-pass\n"); 00682 } 00683 00684 if (r->config->graph.enabled) { 00685 jlog("\n"); 00686 jlog("Graph-based output with graph-oriented search:\n"); 00687 jlog("\t(-lattice) word lattice = %s\n", r->config->graph.lattice ? "yes" : "no"); 00688 jlog("\t(-confnet) confusion network = %s\n", r->config->graph.confnet ? "yes" : "no"); 00689 if (r->config->graph.lattice == TRUE) { 00690 jlog("\t(-graphrange) margin = %d frames", r->config->graph.graph_merge_neighbor_range); 00691 if (r->config->graph.graph_merge_neighbor_range < 0) { 00692 jlog(" (all post-marging disabled)\n"); 00693 } else if (r->config->graph.graph_merge_neighbor_range == 0) { 00694 jlog(" (merge same word with the same boundary)\n"); 00695 } else { 00696 jlog(" (merge same words around this margin)\n"); 00697 } 00698 } 00699 #ifdef GRAPHOUT_DEPTHCUT 00700 jlog("\t(-graphcut)cutoff depth = "); 00701 if (r->config->graph.graphout_cut_depth < 0) { 00702 jlog("disabled (-1)\n"); 00703 } else { 00704 jlog("%d words\n",r->config->graph.graphout_cut_depth); 00705 } 00706 #endif 00707 #ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP 00708 jlog("\t(-graphboundloop)loopmax = %d for boundary adjustment\n",r->config->graph.graphout_limit_boundary_loop_num); 00709 #endif 00710 #ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION 00711 jlog("\tInhibit graph search termination before 1st sentence found = "); 00712 if (r->config->graph.graphout_search_delay) { 00713 jlog("enabled\n"); 00714 } else { 00715 jlog("disabled\n"); 00716 } 00717 #endif 00718 00719 } 00720 00721 if (r->config->successive.enabled) { 00722 jlog("\tshort pause segmentation = on\n"); 00723 jlog("\t sp duration length = %d frames\n", r->config->successive.sp_frame_duration); 00724 #ifdef SPSEGMENT_NAIST 00725 jlog(" backstep margin on trigger = %d frames\n", r->config->successive.sp_margin); 00726 jlog("\t delay on trigger = %d frames\n", r->config->successive.sp_delay); 00727 #endif 00728 if (r->config->successive.pausemodelname) { 00729 jlog("\t pause models for seg. = %s\n", r->config->successive.pausemodelname); 00730 } 00731 } else { 00732 jlog("\tshort pause segmentation = off\n"); 00733 } 00734 if (r->config->output.progout_flag) { 00735 jlog("\t progout interval = %d msec\n", r->config->output.progout_interval); 00736 } 00737 jlog("\tfall back on search fail = "); 00738 if (r->config->sw.fallback_pass1_flag) { 00739 jlog("on, adopt 1st pass result as final\n"); 00740 } else { 00741 jlog("off, returns search failure\n"); 00742 } 00743 00744 jlog("\n"); 00745 } 00746 00747 jlog("------------------------------------------------------------\n"); 00748 jlog("Decoding algorithm:\n\n"); 00749 jlog("\t1st pass input processing = "); 00750 if (jconf->decodeopt.force_realtime_flag) jlog("(forced) "); 00751 if (jconf->decodeopt.realtime_flag) { 00752 jlog("real time, on-the-fly\n"); 00753 } else { 00754 jlog("buffered, batch\n"); 00755 } 00756 jlog("\t1st pass method = "); 00757 #ifdef WPAIR 00758 # ifdef WPAIR_KEEP_NLIMIT 00759 jlog("word-pair approx., keeping only N tokens "); 00760 # else 00761 jlog("word-pair approx. "); 00762 # endif 00763 #else 00764 jlog("1-best approx. "); 00765 #endif 00766 #ifdef WORD_GRAPH 00767 jlog("generating word_graph\n"); 00768 #else 00769 jlog("generating indexed trellis\n"); 00770 #endif 00771 #ifdef CONFIDENCE_MEASURE 00772 jlog("\toutput word confidence measure "); 00773 #ifdef CM_NBEST 00774 jlog("based on N-best candidates\n"); 00775 #endif 00776 #ifdef CM_SEARCH 00777 jlog("based on search-time scores\n"); 00778 #endif 00779 #endif /* CONFIDENCE_MEASURE */ 00780 00781 jlog("\n"); 00782 00783 jlog("------------------------------------------------------------\n"); 00784 jlog("FrontEnd:\n\n"); 00785 00786 jlog(" Input stream:\n"); 00787 jlog("\t input type = "); 00788 switch(jconf->input.type) { 00789 case INPUT_WAVEFORM: 00790 jlog("waveform\n"); 00791 break; 00792 case INPUT_VECTOR: 00793 jlog("feature vector sequence\n"); 00794 break; 00795 } 00796 jlog("\t input source = "); 00797 if (jconf->input.plugin_source != -1) { 00798 jlog("plugin\n"); 00799 } else if (jconf->input.speech_input == SP_RAWFILE) { 00800 jlog("waveform file\n"); 00801 jlog("\t input filelist = "); 00802 if (jconf->input.inputlist_filename == NULL) { 00803 jlog("(none, get file name from stdin)\n"); 00804 } else { 00805 jlog("%s\n", jconf->input.inputlist_filename); 00806 } 00807 } else if (jconf->input.speech_input == SP_MFCFILE) { 00808 jlog("feature vector file (HTK format)\n"); 00809 jlog("\t filelist = "); 00810 if (jconf->input.inputlist_filename == NULL) { 00811 jlog("(none, get file name from stdin)\n"); 00812 } else { 00813 jlog("%s\n", jconf->input.inputlist_filename); 00814 } 00815 } else if (jconf->input.speech_input == SP_STDIN) { 00816 jlog("standard input\n"); 00817 } else if (jconf->input.speech_input == SP_ADINNET) { 00818 jlog("adinnet client\n"); 00819 #ifdef USE_NETAUDIO 00820 } else if (jconf->input.speech_input == SP_NETAUDIO) { 00821 char *p; 00822 jlog("NetAudio server on "); 00823 if (jconf->input.netaudio_devname != NULL) { 00824 jlog("%s\n", jconf->input.netaudio_devname); 00825 } else if ((p = getenv("AUDIO_DEVICE")) != NULL) { 00826 jlog("%s\n", p); 00827 } else { 00828 jlog("local port\n"); 00829 } 00830 #endif 00831 } else if (jconf->input.speech_input == SP_MIC) { 00832 jlog("microphone\n"); 00833 jlog("\t device API = "); 00834 switch(jconf->input.device) { 00835 case SP_INPUT_DEFAULT: jlog("default\n"); break; 00836 case SP_INPUT_ALSA: jlog("alsa\n"); break; 00837 case SP_INPUT_OSS: jlog("oss\n"); break; 00838 case SP_INPUT_ESD: jlog("esd\n"); break; 00839 case SP_INPUT_PULSEAUDIO: jlog("pulseaudio\n"); break; 00840 } 00841 } 00842 if (jconf->input.type == INPUT_WAVEFORM) { 00843 if (jconf->input.speech_input == SP_RAWFILE || jconf->input.speech_input == SP_STDIN || jconf->input.speech_input == SP_ADINNET) { 00844 if (jconf->input.use_ds48to16) { 00845 jlog("\t sampling freq. = assume 48000Hz, then down to %dHz\n", jconf->input.sfreq); 00846 } else { 00847 jlog("\t sampling freq. = %d Hz required\n", jconf->input.sfreq); 00848 } 00849 } else { 00850 if (jconf->input.use_ds48to16) { 00851 jlog("\t sampling freq. = 48000Hz, then down to %d Hz\n", jconf->input.sfreq); 00852 } else { 00853 jlog("\t sampling freq. = %d Hz\n", jconf->input.sfreq); 00854 } 00855 } 00856 } 00857 if (jconf->input.type == INPUT_WAVEFORM) { 00858 jlog("\t threaded A/D-in = "); 00859 #ifdef HAVE_PTHREAD 00860 if (recog->adin->enable_thread) { 00861 jlog("supported, on\n"); 00862 } else { 00863 jlog("supported, off\n"); 00864 } 00865 #else 00866 jlog("not supported (live input may be dropped)\n"); 00867 #endif 00868 } 00869 if (jconf->preprocess.strip_zero_sample) { 00870 jlog("\t zero frames stripping = on\n"); 00871 } else { 00872 jlog("\t zero frames stripping = off\n"); 00873 } 00874 if (jconf->input.type == INPUT_WAVEFORM) { 00875 if (recog->adin->adin_cut_on) { 00876 jlog("\t silence cutting = on\n"); 00877 jlog("\t level thres = %d / 32767\n", jconf->detect.level_thres); 00878 jlog("\t zerocross thres = %d / sec.\n", jconf->detect.zero_cross_num); 00879 jlog("\t head margin = %d msec.\n", jconf->detect.head_margin_msec); 00880 jlog("\t tail margin = %d msec.\n", jconf->detect.tail_margin_msec); 00881 } else { 00882 jlog("\t silence cutting = off\n"); 00883 } 00884 00885 if (jconf->preprocess.use_zmean) { 00886 jlog("\t long-term DC removal = on"); 00887 if (jconf->input.speech_input == SP_RAWFILE) { 00888 jlog(" (will compute for each file)\n"); 00889 } else { 00890 jlog(" (will compute from first %.1f sec)\n", (float)ZMEANSAMPLES / (float)jconf->input.sfreq); 00891 } 00892 } else { 00893 jlog("\t long-term DC removal = off\n"); 00894 } 00895 } 00896 jlog("\t reject short input = "); 00897 if (jconf->reject.rejectshortlen > 0) { 00898 jlog("< %d msec\n", jconf->reject.rejectshortlen); 00899 } else { 00900 jlog("off\n"); 00901 } 00902 #ifdef POWER_REJECT 00903 jlog("\t power rejection thres = %f", jconf->reject.powerthres); 00904 #endif 00905 00906 jlog("\n"); 00907 00908 jlog("----------------------- System Information end -----------------------\n"); 00909 00910 #ifdef USE_MIC 00911 if (jconf->decodeopt.realtime_flag) { 00912 boolean flag; 00913 flag = FALSE; 00914 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00915 if (mfcc->para->cmn && mfcc->cmn.loaded) { 00916 flag = TRUE; 00917 break; 00918 } 00919 } 00920 if (flag) { 00921 jlog("\n"); 00922 jlog("initial CMN parameter loaded from file\nfor"); 00923 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00924 if (mfcc->para->cmn && mfcc->cmn.loaded) { 00925 jlog(" MFCC%02d", mfcc->id); 00926 } 00927 } 00928 jlog("\n"); 00929 } 00930 flag = FALSE; 00931 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00932 if (mfcc->para->cmn && !mfcc->cmn.loaded) { 00933 flag = TRUE; 00934 break; 00935 } 00936 } 00937 if (flag) { 00938 jlog("\n"); 00939 jlog("\t*************************************************************\n"); 00940 jlog("\t* NOTICE: The first input may not be recognized, since *\n"); 00941 jlog("\t* no initial CMN parameter is available on startup. *\n"); 00942 jlog("\t* for"); 00943 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00944 if (mfcc->para->cmn && !mfcc->cmn.loaded) { 00945 jlog(" MFCC%02d", mfcc->id); 00946 } 00947 } 00948 jlog("*\n"); 00949 jlog("\t*************************************************************\n"); 00950 } 00951 flag = FALSE; 00952 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00953 if (mfcc->para->energy && mfcc->para->enormal) { 00954 flag = TRUE; 00955 break; 00956 } 00957 } 00958 if (flag) { 00959 jlog("\t*************************************************************\n"); 00960 jlog("\t* NOTICE: Energy normalization is activated on live input: *\n"); 00961 jlog("\t* maximum energy of LAST INPUT will be used for it. *\n"); 00962 jlog("\t* So, the first input will not be recognized. *\n"); 00963 jlog("\t* for"); 00964 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00965 if (mfcc->para->energy && mfcc->para->enormal) { 00966 jlog(" MFCC%02d", mfcc->id); 00967 } 00968 } 00969 jlog("*\n"); 00970 jlog("\t*************************************************************\n"); 00971 } 00972 } 00973 #endif 00974 } 00975 00976 /* end of file */