Julius 4.1.5
|
00001 00018 /* 00019 * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University 00020 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00021 * Copyright (c) 2005-2007 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 } 00438 00439 if (lm->lmtype == LM_PROB) { 00440 jlog("\t(-silhead)head sil word = "); 00441 put_voca(fp, lm->winfo, lm->winfo->head_silwid); 00442 jlog("\t(-siltail)tail sil word = "); 00443 put_voca(fp, lm->winfo, lm->winfo->tail_silwid); 00444 } 00445 00446 if (lm->lmvar == LM_DFA_WORD) { 00447 jlog(" silence model names to add at word head / tail: (-wsil)\n"); 00448 jlog("\tword head = \"%s\"\n", lm->config->wordrecog_head_silence_model_name); 00449 jlog("\tword tail = \"%s\"\n", lm->config->wordrecog_tail_silence_model_name); 00450 jlog("\ttheir context name = \"%s\"\n", (lm->config->wordrecog_silence_context_name[0] == '\0') ? "NULL (blank)" : lm->config->wordrecog_silence_context_name); 00451 00452 } 00453 00454 } 00455 00456 jlog("\n"); 00457 jlog("------------------------------------------------------------\n"); 00458 jlog("Recognizer(s)\n\n"); 00459 00460 for(r = recog->process_list; r; r = r->next) { 00461 jlog("[SR%02d", r->config->id); 00462 if (r->config->name[0] != '\0') { 00463 jlog(" \"%s\"", r->config->name); 00464 } 00465 jlog("] "); 00466 if (r->am->config->name[0] != '\0') { 00467 jlog("AM%02d \"%s\"", r->am->config->id, r->am->config->name); 00468 } else { 00469 jlog("AM%02d", r->am->config->id); 00470 } 00471 jlog(" + "); 00472 if (r->lm->config->name[0] != '\0') { 00473 jlog("LM%02d \"%s\"", r->lm->config->id, r->lm->config->name); 00474 } else { 00475 jlog("LM%02d", r->lm->config->id); 00476 } 00477 jlog("\n\n"); 00478 00479 if (r->wchmm != NULL) { 00480 print_wchmm_info(r->wchmm); jlog("\n"); 00481 } 00482 if (r->lmtype == LM_PROB) { 00483 jlog(" Inter-word N-gram cache: \n"); 00484 { 00485 int num, len; 00486 #ifdef UNIGRAM_FACTORING 00487 len = r->wchmm->isolatenum; 00488 jlog("\troot node to be cached = %d / %d (isolated only)\n", 00489 len, r->wchmm->startnum); 00490 #else 00491 len = r->wchmm->startnum; 00492 jlog("\troot node to be cached = %d (all)\n", len); 00493 #endif 00494 #ifdef HASH_CACHE_IW 00495 num = (r->config->pass1.iw_cache_rate * r->lm->ngram->max_word_num) / 100; 00496 jlog("\tword ends to be cached = %d / %d\n", num, r->lm->ngram->max_word_num); 00497 #else 00498 num = r->lm->ngram->max_word_num; 00499 jlog("\tword ends to be cached = %d (all)\n", num); 00500 #endif 00501 jlog("\t max. allocation size = %dMB\n", num * len / 1000 * sizeof(LOGPROB) / 1000); 00502 } 00503 } 00504 00505 if (r->lmtype == LM_PROB) { 00506 jlog("\t(-lmp) pass1 LM weight = %2.1f ins. penalty = %+2.1f\n", r->config->lmp.lm_weight, r->config->lmp.lm_penalty); 00507 jlog("\t(-lmp2) pass2 LM weight = %2.1f ins. penalty = %+2.1f\n", r->config->lmp.lm_weight2, r->config->lmp.lm_penalty2); 00508 jlog("\t(-transp)trans. penalty = %+2.1f per word\n", r->config->lmp.lm_penalty_trans); 00509 } else if (r->lmtype == LM_DFA && r->lmvar == LM_DFA_GRAMMAR) { 00510 jlog("\t(-penalty1) IW penalty1 = %+2.1f\n", r->config->lmp.penalty1); 00511 jlog("\t(-penalty2) IW penalty2 = %+2.1f\n", r->config->lmp.penalty2); 00512 } 00513 00514 00515 #ifdef CONFIDENCE_MEASURE 00516 #ifdef CM_MULTIPLE_ALPHA 00517 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); 00518 #else 00519 jlog("\t(-cmalpha)CM alpha coef = %f\n", r->config->annotate.cm_alpha); 00520 #endif 00521 #ifdef CM_SEARCH_LIMIT 00522 jlog("\t(-cmthres) CM cut thres = %f for hypo generation\n", r->config->annotate.cm_cut_thres); 00523 #endif 00524 #ifdef CM_SEARCH_LIMIT_POP 00525 jlog("\t(-cmthres2)CM cut thres = %f for popped hypo\n", r->config->annotate.cm_cut_thres_pop); 00526 #endif 00527 #endif /* CONFIDENCE_MEASURE */ 00528 jlog("\n"); 00529 00530 if (r->am->hmminfo->multipath) { 00531 if (r->lm->config->enable_iwsp) { 00532 jlog("\t inter-word short pause = on (append \"%s\" for each word tail)\n", r->am->hmminfo->sp->name); 00533 jlog("\t sp transition penalty = %+2.1f\n", r->am->config->iwsp_penalty); 00534 } 00535 } 00536 00537 if (r->lmvar == LM_DFA_WORD) { 00538 #ifdef DETERMINE 00539 jlog(" early word determination: (-wed)\n"); 00540 jlog("\tscore threshold = %f\n", r->config->pass1.determine_score_thres); 00541 jlog("\tframe dur. thres = %d\n", r->config->pass1.determine_duration_thres); 00542 #endif 00543 } 00544 00545 jlog(" Search parameters: \n"); 00546 jlog("\t multi-path handling = "); 00547 if (r->am->hmminfo->multipath) { 00548 jlog("yes, multi-path mode enabled\n"); 00549 } else { 00550 jlog("no\n"); 00551 } 00552 jlog("\t(-b) trellis beam width = %d", r->trellis_beam_width); 00553 if (r->config->pass1.specified_trellis_beam_width == -1) { 00554 jlog(" (-1 or not specified - guessed)\n"); 00555 } else if (r->config->pass1.specified_trellis_beam_width == 0) { 00556 jlog(" (0 - full)\n"); 00557 } else { 00558 jlog("\n"); 00559 } 00560 jlog("\t(-n)search candidate num= %d\n", r->config->pass2.nbest); 00561 jlog("\t(-s) search stack size = %d\n", r->config->pass2.stack_size); 00562 jlog("\t(-m) search overflow = after %d hypothesis poped\n", r->config->pass2.hypo_overflow); 00563 jlog("\t 2nd pass method = "); 00564 if (r->config->graph.enabled) { 00565 #ifdef GRAPHOUT_DYNAMIC 00566 #ifdef GRAPHOUT_SEARCH 00567 jlog("searching graph, generating dynamic graph\n"); 00568 #else 00569 jlog("searching sentence, generating dynamic graph\n"); 00570 #endif /* GRAPHOUT_SEARCH */ 00571 #else /* ~GRAPHOUT_DYNAMIC */ 00572 jlog("searching sentence, generating static graph from N-best\n"); 00573 #endif 00574 } else { 00575 jlog("searching sentence, generating N-best\n"); 00576 } 00577 if (r->config->pass2.enveloped_bestfirst_width >= 0) { 00578 jlog("\t(-b2) pass2 beam width = %d\n", r->config->pass2.enveloped_bestfirst_width); 00579 } 00580 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); 00581 #ifdef SCAN_BEAM 00582 jlog("\t(-sb)2nd scan beamthres = %.1f (in logscore)\n", r->config->pass2.scan_beam_thres); 00583 #endif 00584 jlog("\t(-n) search till = %d candidates found\n", r->config->pass2.nbest); 00585 jlog("\t(-output) and output = %d candidates out of above\n", r->config->output.output_hypo_maxnum); 00586 00587 if (r->ccd_flag) { 00588 jlog("\t IWCD handling:\n"); 00589 #ifdef PASS1_IWCD 00590 jlog("\t 1st pass: approximation "); 00591 switch(r->am->hmminfo->cdset_method) { 00592 case IWCD_AVG: 00593 jlog("(use average prob. of same LC)\n"); 00594 break; 00595 case IWCD_MAX: 00596 jlog("(use max. prob. of same LC)\n"); 00597 break; 00598 case IWCD_NBEST: 00599 jlog("(use %d-best of same LC)\n", r->am->hmminfo->cdmax_num); 00600 break; 00601 } 00602 #else 00603 jlog("\t 1st pass: ignored\n"); 00604 #endif 00605 #ifdef PASS2_STRICT_IWCD 00606 jlog("\t 2nd pass: strict (apply when expanding hypo. )\n"); 00607 #else 00608 jlog("\t 2nd pass: loose (apply when hypo. is popped and scanned)\n"); 00609 #endif 00610 } 00611 if (r->lmtype == LM_PROB) { 00612 jlog("\t factoring score: "); 00613 #ifdef UNIGRAM_FACTORING 00614 jlog("1-gram prob. (statically assigned beforehand)\n"); 00615 #else 00616 jlog("2-gram prob. (dynamically computed while search)\n"); 00617 #endif 00618 } 00619 00620 if (r->config->annotate.align_result_word_flag) { 00621 jlog("\t output word alignments\n"); 00622 } 00623 if (r->config->annotate.align_result_phoneme_flag) { 00624 jlog("\t output phoneme alignments\n"); 00625 } 00626 if (r->config->annotate.align_result_state_flag) { 00627 jlog("\t output state alignments\n"); 00628 } 00629 if (r->lmtype == LM_DFA && r->lmvar == LM_DFA_GRAMMAR) { 00630 if (r->config->pass2.looktrellis_flag) { 00631 jlog("\t only words in backtrellis will be expanded in 2nd pass\n"); 00632 } else { 00633 jlog("\t all possible words will be expanded in 2nd pass\n"); 00634 } 00635 } 00636 if (r->wchmm != NULL) { 00637 if (r->wchmm->category_tree) { 00638 if (r->config->pass1.old_tree_function_flag) { 00639 jlog("\t build_wchmm() used\n"); 00640 } else { 00641 jlog("\t build_wchmm2() used\n"); 00642 } 00643 #ifdef PASS1_IWCD 00644 #ifdef USE_OLD_IWCD 00645 jlog("\t full lcdset used\n"); 00646 #else 00647 jlog("\t lcdset limited by word-pair constraint\n"); 00648 #endif 00649 #endif /* PASS1_IWCD */ 00650 } 00651 } 00652 if (r->config->output.progout_flag) { 00653 jlog("\tprogressive output on 1st pass\n"); 00654 } 00655 if (r->config->compute_only_1pass) { 00656 jlog("\tCompute only 1-pass\n"); 00657 } 00658 00659 if (r->config->graph.enabled) { 00660 jlog("\n"); 00661 jlog("Graph-based output with graph-oriented search:\n"); 00662 jlog("\t(-lattice) word lattice = %s\n", r->config->graph.lattice ? "yes" : "no"); 00663 jlog("\t(-confnet) confusion network = %s\n", r->config->graph.confnet ? "yes" : "no"); 00664 if (r->config->graph.lattice == TRUE) { 00665 jlog("\t(-graphrange) margin = %d frames", r->config->graph.graph_merge_neighbor_range); 00666 if (r->config->graph.graph_merge_neighbor_range < 0) { 00667 jlog(" (all post-marging disabled)\n"); 00668 } else if (r->config->graph.graph_merge_neighbor_range == 0) { 00669 jlog(" (merge same word with the same boundary)\n"); 00670 } else { 00671 jlog(" (merge same words around this margin)\n"); 00672 } 00673 } 00674 #ifdef GRAPHOUT_DEPTHCUT 00675 jlog("\t(-graphcut)cutoff depth = "); 00676 if (r->config->graph.graphout_cut_depth < 0) { 00677 jlog("disabled (-1)\n"); 00678 } else { 00679 jlog("%d words\n",r->config->graph.graphout_cut_depth); 00680 } 00681 #endif 00682 #ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP 00683 jlog("\t(-graphboundloop)loopmax = %d for boundary adjustment\n",r->config->graph.graphout_limit_boundary_loop_num); 00684 #endif 00685 #ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION 00686 jlog("\tInhibit graph search termination before 1st sentence found = "); 00687 if (r->config->graph.graphout_search_delay) { 00688 jlog("enabled\n"); 00689 } else { 00690 jlog("disabled\n"); 00691 } 00692 #endif 00693 00694 } 00695 00696 if (r->config->successive.enabled) { 00697 jlog("\tshort pause segmentation = on\n"); 00698 jlog("\t sp duration length = %d frames\n", r->config->successive.sp_frame_duration); 00699 #ifdef SPSEGMENT_NAIST 00700 jlog(" backstep margin on trigger = %d frames\n", r->config->successive.sp_margin); 00701 jlog("\t delay on trigger = %d frames\n", r->config->successive.sp_delay); 00702 #endif 00703 if (r->config->successive.pausemodelname) { 00704 jlog("\t pause models for seg. = %s\n", r->config->successive.pausemodelname); 00705 } 00706 } else { 00707 jlog("\tshort pause segmentation = off\n"); 00708 } 00709 if (r->config->output.progout_flag) { 00710 jlog("\t progout interval = %d msec\n", r->config->output.progout_interval); 00711 } 00712 jlog("\tfall back on search fail = "); 00713 if (r->config->sw.fallback_pass1_flag) { 00714 jlog("on, adopt 1st pass result as final\n"); 00715 } else { 00716 jlog("off, returns search failure\n"); 00717 } 00718 00719 jlog("\n"); 00720 } 00721 00722 jlog("------------------------------------------------------------\n"); 00723 jlog("Decoding algorithm:\n\n"); 00724 jlog("\t1st pass input processing = "); 00725 if (jconf->decodeopt.force_realtime_flag) jlog("(forced) "); 00726 if (jconf->decodeopt.realtime_flag) { 00727 jlog("real time, on-the-fly\n"); 00728 } else { 00729 jlog("buffered, batch\n"); 00730 } 00731 jlog("\t1st pass method = "); 00732 #ifdef WPAIR 00733 # ifdef WPAIR_KEEP_NLIMIT 00734 jlog("word-pair approx., keeping only N tokens "); 00735 # else 00736 jlog("word-pair approx. "); 00737 # endif 00738 #else 00739 jlog("1-best approx. "); 00740 #endif 00741 #ifdef WORD_GRAPH 00742 jlog("generating word_graph\n"); 00743 #else 00744 jlog("generating indexed trellis\n"); 00745 #endif 00746 #ifdef CONFIDENCE_MEASURE 00747 jlog("\toutput word confidence measure "); 00748 #ifdef CM_NBEST 00749 jlog("based on N-best candidates\n"); 00750 #endif 00751 #ifdef CM_SEARCH 00752 jlog("based on search-time scores\n"); 00753 #endif 00754 #endif /* CONFIDENCE_MEASURE */ 00755 00756 jlog("\n"); 00757 00758 jlog("------------------------------------------------------------\n"); 00759 jlog("FrontEnd:\n\n"); 00760 00761 jlog(" Input stream:\n"); 00762 jlog("\t input type = "); 00763 switch(jconf->input.type) { 00764 case INPUT_WAVEFORM: 00765 jlog("waveform\n"); 00766 break; 00767 case INPUT_VECTOR: 00768 jlog("feature vector sequence\n"); 00769 break; 00770 } 00771 jlog("\t input source = "); 00772 if (jconf->input.plugin_source != -1) { 00773 jlog("plugin\n"); 00774 } else if (jconf->input.speech_input == SP_RAWFILE) { 00775 jlog("waveform file\n"); 00776 jlog("\t input filelist = "); 00777 if (jconf->input.inputlist_filename == NULL) { 00778 jlog("(none, get file name from stdin)\n"); 00779 } else { 00780 jlog("%s\n", jconf->input.inputlist_filename); 00781 } 00782 } else if (jconf->input.speech_input == SP_MFCFILE) { 00783 jlog("feature vector file (HTK format)\n"); 00784 jlog("\t filelist = "); 00785 if (jconf->input.inputlist_filename == NULL) { 00786 jlog("(none, get file name from stdin)\n"); 00787 } else { 00788 jlog("%s\n", jconf->input.inputlist_filename); 00789 } 00790 } else if (jconf->input.speech_input == SP_STDIN) { 00791 jlog("standard input\n"); 00792 } else if (jconf->input.speech_input == SP_ADINNET) { 00793 jlog("adinnet client\n"); 00794 #ifdef USE_NETAUDIO 00795 } else if (jconf->input.speech_input == SP_NETAUDIO) { 00796 char *p; 00797 jlog("NetAudio server on "); 00798 if (jconf->input.netaudio_devname != NULL) { 00799 jlog("%s\n", jconf->input.netaudio_devname); 00800 } else if ((p = getenv("AUDIO_DEVICE")) != NULL) { 00801 jlog("%s\n", p); 00802 } else { 00803 jlog("local port\n"); 00804 } 00805 #endif 00806 } else if (jconf->input.speech_input == SP_MIC) { 00807 jlog("microphone\n"); 00808 jlog("\t device API = "); 00809 switch(jconf->input.device) { 00810 case SP_INPUT_DEFAULT: jlog("default\n"); break; 00811 case SP_INPUT_ALSA: jlog("alsa\n"); break; 00812 case SP_INPUT_OSS: jlog("oss\n"); break; 00813 case SP_INPUT_ESD: jlog("esd\n"); break; 00814 } 00815 } 00816 if (jconf->input.type == INPUT_WAVEFORM) { 00817 if (jconf->input.speech_input == SP_RAWFILE || jconf->input.speech_input == SP_STDIN || jconf->input.speech_input == SP_ADINNET) { 00818 if (jconf->input.use_ds48to16) { 00819 jlog("\t sampling freq. = assume 48000Hz, then down to %dHz\n", jconf->input.sfreq); 00820 } else { 00821 jlog("\t sampling freq. = %d Hz required\n", jconf->input.sfreq); 00822 } 00823 } else { 00824 if (jconf->input.use_ds48to16) { 00825 jlog("\t sampling freq. = 48000Hz, then down to %d Hz\n", jconf->input.sfreq); 00826 } else { 00827 jlog("\t sampling freq. = %d Hz\n", jconf->input.sfreq); 00828 } 00829 } 00830 } 00831 if (jconf->input.type == INPUT_WAVEFORM) { 00832 jlog("\t threaded A/D-in = "); 00833 #ifdef HAVE_PTHREAD 00834 if (recog->adin->enable_thread) { 00835 jlog("supported, on\n"); 00836 } else { 00837 jlog("supported, off\n"); 00838 } 00839 #else 00840 jlog("not supported (live input may be dropped)\n"); 00841 #endif 00842 } 00843 if (jconf->preprocess.strip_zero_sample) { 00844 jlog("\t zero frames stripping = on\n"); 00845 } else { 00846 jlog("\t zero frames stripping = off\n"); 00847 } 00848 if (jconf->input.type == INPUT_WAVEFORM) { 00849 if (recog->adin->adin_cut_on) { 00850 jlog("\t silence cutting = on\n"); 00851 jlog("\t level thres = %d / 32767\n", jconf->detect.level_thres); 00852 jlog("\t zerocross thres = %d / sec.\n", jconf->detect.zero_cross_num); 00853 jlog("\t head margin = %d msec.\n", jconf->detect.head_margin_msec); 00854 jlog("\t tail margin = %d msec.\n", jconf->detect.tail_margin_msec); 00855 } else { 00856 jlog("\t silence cutting = off\n"); 00857 } 00858 00859 if (jconf->preprocess.use_zmean) { 00860 jlog("\t long-term DC removal = on"); 00861 if (jconf->input.speech_input == SP_RAWFILE) { 00862 jlog(" (will compute for each file)\n"); 00863 } else { 00864 jlog(" (will compute from first %.1f sec)\n", (float)ZMEANSAMPLES / (float)jconf->input.sfreq); 00865 } 00866 } else { 00867 jlog("\t long-term DC removal = off\n"); 00868 } 00869 } 00870 jlog("\t reject short input = "); 00871 if (jconf->reject.rejectshortlen > 0) { 00872 jlog("< %d msec\n", jconf->reject.rejectshortlen); 00873 } else { 00874 jlog("off\n"); 00875 } 00876 #ifdef POWER_REJECT 00877 jlog("\t power rejection thres = %f", jconf->reject.powerthres); 00878 #endif 00879 00880 jlog("\n"); 00881 00882 jlog("----------------------- System Information end -----------------------\n"); 00883 00884 #ifdef USE_MIC 00885 if (jconf->decodeopt.realtime_flag) { 00886 boolean flag; 00887 flag = FALSE; 00888 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00889 if (mfcc->para->cmn && mfcc->cmn.loaded) { 00890 flag = TRUE; 00891 break; 00892 } 00893 } 00894 if (flag) { 00895 jlog("\n"); 00896 jlog("initial CMN parameter loaded from file\nfor"); 00897 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00898 if (mfcc->para->cmn && mfcc->cmn.loaded) { 00899 jlog(" MFCC%02d", mfcc->id); 00900 } 00901 } 00902 jlog("\n"); 00903 } 00904 flag = FALSE; 00905 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00906 if (mfcc->para->cmn && !mfcc->cmn.loaded) { 00907 flag = TRUE; 00908 break; 00909 } 00910 } 00911 if (flag) { 00912 jlog("\n"); 00913 jlog("\t*************************************************************\n"); 00914 jlog("\t* NOTICE: The first input may not be recognized, since *\n"); 00915 jlog("\t* no initial CMN parameter is available on startup. *\n"); 00916 jlog("\t* for"); 00917 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00918 if (mfcc->para->cmn && !mfcc->cmn.loaded) { 00919 jlog(" MFCC%02d", mfcc->id); 00920 } 00921 } 00922 jlog("*\n"); 00923 jlog("\t*************************************************************\n"); 00924 } 00925 flag = FALSE; 00926 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00927 if (mfcc->para->energy && mfcc->para->enormal) { 00928 flag = TRUE; 00929 break; 00930 } 00931 } 00932 if (flag) { 00933 jlog("\t*************************************************************\n"); 00934 jlog("\t* NOTICE: Energy normalization is activated on live input: *\n"); 00935 jlog("\t* maximum energy of LAST INPUT will be used for it. *\n"); 00936 jlog("\t* So, the first input will not be recognized. *\n"); 00937 jlog("\t* for"); 00938 for(mfcc=recog->mfcclist; mfcc; mfcc=mfcc->next) { 00939 if (mfcc->para->energy && mfcc->para->enormal) { 00940 jlog(" MFCC%02d", mfcc->id); 00941 } 00942 } 00943 jlog("*\n"); 00944 jlog("\t*************************************************************\n"); 00945 } 00946 } 00947 #endif 00948 } 00949 00950 /* end of file */