00001
00017
00018
00019
00020
00021
00022
00023
00024 #include <julius.h>
00025
00036 void
00037 print_setting()
00038 {
00039 #ifdef USE_NETAUDIO
00040 char *p;
00041 #endif
00042 #ifdef USE_DFA
00043 GRAMLIST *g;
00044 int n;
00045 #endif
00046
00047 j_printf(" hmmfilename=%s\n",hmmfilename);
00048 if (mapfilename != NULL) {
00049 j_printf(" hmmmapfilename=%s\n",mapfilename);
00050 }
00051 #ifdef USE_NGRAM
00052 j_printf(" vocabulary filename=%s\n",dictfilename);
00053 if (ngram_filename != NULL) {
00054 j_printf(" n-gram filename=%s (binary format)\n",ngram_filename);
00055 } else {
00056 j_printf(" LR 2-gram filename=%s\n",ngram_filename_lr_arpa);
00057 if (ngram_filename_rl_arpa != NULL) {
00058 j_printf(" RL 3-gram filename=%s\n",ngram_filename_rl_arpa);
00059 }
00060 }
00061 #else
00062 n = 1;
00063 for(g = gramlist_root; g; g = g->next) {
00064 j_printf(" grammar #%d:\n", n++);
00065 j_printf(" dfa = %s\n", g->dfafile);
00066 j_printf(" dict = %s\n", g->dictfile);
00067 }
00068 #endif
00069 if (hmm_gs_filename != NULL) {
00070 j_printf(" hmmfile for Gaussian Selection: %s\n", hmm_gs_filename);
00071 }
00072 if (gmm_filename != NULL) {
00073 j_printf(" GMM file for utterance verification: %s\n", gmm_filename);
00074 }
00075 }
00076
00087 void
00088 print_info()
00089 {
00090 j_printf("------------- System Info begin -------------\n");
00091 put_header(stdout);
00092 if (verbose_flag) {
00093 put_compile_defs(stdout);
00094 j_printf("\n");
00095 #ifdef USE_NGRAM
00096 j_printf("Large Vocabulary Continuous Speech Recognition Based on N-gram\n\n");
00097 #else
00098 j_printf("Continuous Speech Recognition Parser based on automaton grammar\n\n");
00099 #endif
00100 }
00101
00102
00103 j_printf("Files:\n");
00104 print_setting();
00105 j_printf("\n");
00106
00107
00108 if (speech_input == SP_RAWFILE) {
00109 j_printf("Speech input source: file\n\n");
00110 } else if (speech_input == SP_MFCFILE) {
00111 j_printf("Speech input source: MFCC parameter file (HTK format)\n\n");
00112 }
00113
00114 if (speech_input != SP_MFCFILE) {
00115
00116 put_para(¶);
00117
00118 j_printf("\t base setup from =");
00119 if (para_htk.loaded == 1 || para_hmm.loaded == 1) {
00120 if (para_hmm.loaded == 1) {
00121 j_printf(" binhmm-embedded");
00122 if (para_htk.loaded == 1) {
00123 j_printf(", then overridden by HTK Config and defaults");
00124 }
00125 } else {
00126 if (para_htk.loaded == 1) {
00127 j_printf(" HTK Config (and HTK defaults)");
00128 }
00129 }
00130 } else {
00131 j_printf(" Julius defaults");
00132 }
00133 j_printf("\n");
00134
00135
00136 j_printf("\n");
00137 j_printf(" spectral subtraction = ");
00138 if (ssload_filename || sscalc) {
00139 if (sscalc) {
00140 j_printf("use head silence of each input\n");
00141 if (speech_input != SP_RAWFILE) {
00142 j_error("Error: ss calculation with head silence only for rawfile input\n");
00143 }
00144 j_printf("\t head sil length = %d msec\n", sscalc_len);
00145 } else {
00146 j_printf("use a constant value from file\n");
00147 j_printf(" noise spectrum file = \"%s\"\n", ssload_filename);
00148 }
00149 j_printf("\t alpha coef. = %f\n", para.ss_alpha);
00150 j_printf("\t spectral floor = %f\n", para.ss_floor);
00151 } else {
00152 j_printf("off\n");
00153 }
00154 j_printf("\n");
00155 }
00156
00157 print_hmmdef_info(hmminfo); j_printf("\n");
00158 if (hmm_gs_filename != NULL) {
00159 j_printf("GS ");
00160 print_hmmdef_info(hmm_gs); j_printf("\n");
00161 }
00162 if (winfo != NULL) {
00163 print_voca_info(winfo); j_printf("\n");
00164 }
00165 if (wchmm != NULL) {
00166 print_wchmm_info(wchmm); j_printf("\n");
00167 }
00168 #ifdef USE_NGRAM
00169 print_ngram_info(ngram);
00170 #else
00171 if (dfa != NULL) {
00172 print_dfa_info(dfa);
00173 if (debug2_flag) print_dfa_cp(dfa);
00174 }
00175 #endif
00176
00177 #ifdef USE_NGRAM
00178 j_printf(" inter-word N-gram cache: \n");
00179 {
00180 int num, len;
00181 #ifdef UNIGRAM_FACTORING
00182 len = wchmm->isolatenum;
00183 j_printf("\t root node to be cached = %d / %d (isolated only)\n",
00184 len, wchmm->startnum);
00185 #else
00186 len = wchmm->startnum;
00187 j_printf("\t root node to be cached = %d (all)\n", len);
00188 #endif
00189 #ifdef HASH_CACHE_IW
00190 num = (iw_cache_rate * ngram->max_word_num) / 100;
00191 j_printf("\tword end num to be cached = %d / %d\n", num, ngram->max_word_num);
00192 #else
00193 num = ngram->max_word_num;
00194 j_printf("\tword end num to be cached = %d (all)\n", num);
00195 #endif
00196 j_printf("\t maximum allocation size = %dMB\n", num * len / 1000 * sizeof(LOGPROB) / 1000);
00197 }
00198
00199 #endif
00200
00201 j_printf("\nWeights and words: \n");
00202 #ifdef USE_NGRAM
00203 j_printf("\t(-lmp) pass1 LM weight = %2.1f ins. penalty = %+2.1f\n", lm_weight, lm_penalty);
00204 j_printf("\t(-lmp2) pass2 LM weight = %2.1f ins. penalty = %+2.1f\n", lm_weight2, lm_penalty2);
00205 j_printf("\t(-transp)trans. penalty = %+2.1f per word\n", lm_penalty_trans);
00206 j_printf("\t(-silhead)head sil word = ");
00207 put_voca(winfo, winfo->head_silwid);
00208 j_printf("\t(-siltail)tail sil word = ");
00209 put_voca(winfo, winfo->tail_silwid);
00210 #else
00211 j_printf("\t(-penalty1) IW penalty1 = %+2.1f\n", penalty1);
00212 j_printf("\t(-penalty2) IW penalty2 = %+2.1f\n", penalty2);
00213 #endif
00214
00215 #ifdef CONFIDENCE_MEASURE
00216 #ifdef CM_MULTIPLE_ALPHA
00217 j_printf("\t(-cmalpha)CM alpha coef = from %f to %f by step of %f (%d outputs)\n", cm_alpha_bgn, cm_alpha_end, cm_alpha_step, cm_alpha_num);
00218 #else
00219 j_printf("\t(-cmalpha)CM alpha coef = %f\n", cm_alpha);
00220 #endif
00221 #ifdef CM_SEARCH_LIMIT
00222 j_printf("\t(-cmthres) CM cut thres = %f for hypo generation\n", cm_cut_thres);
00223 #endif
00224 #ifdef CM_SEARCH_LIMIT_POP
00225 j_printf("\t(-cmthres2)CM cut thres = %f for popped hypo\n", cm_cut_thres_pop);
00226 #endif
00227 #endif
00228 j_printf("\t(-sp)shortpause HMM name= \"%s\" specified", spmodel_name);
00229 if (hmminfo->sp != NULL) {
00230 j_printf(", \"%s\" applied", hmminfo->sp->name);
00231 if (hmminfo->sp->is_pseudo) {
00232 j_printf(" (pseudo)");
00233 } else {
00234 j_printf(" (physical)");
00235 }
00236 }
00237 j_printf("\n");
00238 #ifdef USE_DFA
00239 if (dfa != NULL) {
00240 int i;
00241 j_printf("\t found sp category IDs =");
00242 for(i=0;i<dfa->term_num;i++) {
00243 if (dfa->is_sp[i]) {
00244 j_printf(" %d", i);
00245 }
00246 }
00247 j_printf("\n");
00248 }
00249 #endif
00250 #ifdef MULTIPATH_VERSION
00251 if (enable_iwsp) {
00252 j_printf("\t inter-word short pause = on (append \"%s\" for each word tail)\n", hmminfo->sp->name);
00253 j_printf("\t sp transition penalty = %+2.1f\n", iwsp_penalty);
00254 }
00255 #endif
00256 #ifdef USE_NGRAM
00257 if (enable_iwspword) {
00258 j_printf("\tIW-sp word added to dict= \"%s\"\n", iwspentry);
00259 }
00260 #endif
00261
00262 if (gmm != NULL) {
00263 j_printf("\nUtterance verification by GMM\n");
00264 j_printf(" GMM defs file = %s\n", gmm_filename);
00265 j_printf(" GMM gprune num = %d\n", gmm_gprune_num);
00266 if (gmm_reject_cmn_string != NULL) {
00267 j_printf(" GMM names to reject = %s\n", gmm_reject_cmn_string);
00268 }
00269 j_printf(" ");
00270 print_hmmdef_info(gmm);
00271 }
00272
00273 if (realtime_flag && para.cmn) {
00274 j_printf("\nMAP-CMN on realtime input: \n");
00275 if (cmnload_filename) {
00276 if (cmn_loaded) {
00277 j_printf("\t initial CMN param = from \"%s\"\n", cmnload_filename);
00278 } else {
00279 j_printf("\t initial CMN param = from \"%s\" (failed, ignored)\n", cmnload_filename);
00280 }
00281 } else {
00282 j_printf("\t initial CMN param = not specified\n");
00283 }
00284 j_printf("\t initial mean weight = %6.2f\n", cmn_map_weight);
00285 if (cmn_update) {
00286 j_printf("\t CMN param update = yes, update from last inputs\n");
00287 } else {
00288 j_printf("\t CMN param update = no, keep initial\n");
00289 }
00290 if (cmnsave_filename) {
00291 if (realtime_flag) {
00292 j_printf("\t save CMN param to = %s\n", cmnsave_filename);
00293 } else {
00294 j_printf("\t save CMN param to = %s (not realtime CMN, ignored)\n", cmnsave_filename);
00295 }
00296 }
00297 }
00298
00299 j_printf("\nSearch parameters: \n");
00300
00301 j_printf("\t 1st pass decoding = ");
00302 if (force_realtime_flag) j_printf("(forced) ");
00303 if (realtime_flag) {
00304 j_printf("on-the-fly");
00305 if (speech_input != SP_MFCFILE && para.cmn) j_printf(" with MAP-CMN");
00306 j_printf("\n");
00307 } else {
00308 j_printf("batch");
00309 if (speech_input != SP_MFCFILE && para.cmn) j_printf(" with sentence CMN");
00310 j_printf("\n");
00311 }
00312 j_printf("\t 1st pass method = ");
00313 #ifdef WPAIR
00314 # ifdef WPAIR_KEEP_NLIMIT
00315 j_printf("word-pair approx., keeping only N tokens ");
00316 # else
00317 j_printf("word-pair approx. ");
00318 # endif
00319 #else
00320 j_printf("1-best approx. ");
00321 #endif
00322 #ifdef WORD_GRAPH
00323 j_printf("generating word_graph\n");
00324 #else
00325 j_printf("generating indexed trellis\n");
00326 #endif
00327
00328 j_printf("\t(-b) trellis beam width = %d", trellis_beam_width);
00329 if (specified_trellis_beam_width == -1) {
00330 j_printf(" (-1 or not specified - guessed)\n");
00331 } else if (specified_trellis_beam_width == 0) {
00332 j_printf(" (0 - full)\n");
00333 } else {
00334 j_printf("\n");
00335 }
00336 j_printf("\t(-n)search candidate num= %d\n", nbest);
00337 j_printf("\t(-s) search stack size = %d\n", stack_size);
00338 j_printf("\t(-m) search overflow = after %d hypothesis poped\n", hypo_overflow);
00339 j_printf("\t 2nd pass method = ");
00340 #ifdef GRAPHOUT
00341 #ifdef GRAPHOUT_DYNAMIC
00342 #ifdef GRAPHOUT_SEARCH
00343 j_printf("searching graph, generating dynamic graph\n");
00344 #else
00345 j_printf("searching sentence, generating dynamic graph\n");
00346 #endif
00347 #else
00348 j_printf("searching sentence, generating static graph from N-best\n");
00349 #endif
00350 #else
00351 j_printf("searching sentence, generating N-best\n");
00352 #endif
00353 if (enveloped_bestfirst_width >= 0) {
00354 j_printf("\t(-b2) pass2 beam width = %d\n", enveloped_bestfirst_width);
00355 }
00356 j_printf("\t(-lookuprange)lookup range= %d (tm-%d <= t <tm+%d)\n",lookup_range,lookup_range,lookup_range);
00357 #ifdef SCAN_BEAM
00358 j_printf("\t(-sb)2nd scan beamthres = %.1f (in logscore)\n",scan_beam_thres);
00359 #endif
00360 j_printf("\t(-gprune)Gauss. pruning = ");
00361 switch(gprune_method){
00362 case GPRUNE_SEL_NONE: j_printf("none (full computation)\n"); break;
00363 case GPRUNE_SEL_BEAM: j_printf("beam\n"); break;
00364 case GPRUNE_SEL_HEURISTIC: j_printf("heuristic\n"); break;
00365 case GPRUNE_SEL_SAFE: j_printf("safe\n"); break;
00366 }
00367 if (gprune_method != GPRUNE_SEL_NONE) {
00368 j_printf("\t(-tmix) mixture thres = %d / %d\n", mixnum_thres, hmminfo->maxcodebooksize);
00369 }
00370 if (hmm_gs_filename != NULL) {
00371 j_printf("\t(-gsnum) GS state num = %d / %d selected\n", gs_statenum, hmm_gs->totalstatenum);
00372 }
00373
00374 j_printf("\t(-n) search till = %d candidates found\n", nbest);
00375 j_printf("\t(-output) and output = %d candidates out of above\n", output_hypo_maxnum);
00376 if (ccd_flag) {
00377 j_printf("\t IWCD handling:\n");
00378 #ifdef PASS1_IWCD
00379 j_printf("\t 1st pass: approximation ");
00380 switch(hmminfo->cdset_method) {
00381 case IWCD_AVG:
00382 j_printf("(use average prob. of same LC)\n");
00383 break;
00384 case IWCD_MAX:
00385 j_printf("(use max. prob. of same LC)\n");
00386 break;
00387 case IWCD_NBEST:
00388 j_printf("(use %d-best of same LC)\n", hmminfo->cdmax_num);
00389 break;
00390 }
00391 #else
00392 j_printf("\t 1st pass: ignored\n");
00393 #endif
00394 #ifdef PASS2_STRICT_IWCD
00395 j_printf("\t 2nd pass: strict (apply when expanding hypo. )\n");
00396 #else
00397 j_printf("\t 2nd pass: loose (apply when hypo. is popped and scanned)\n");
00398 #endif
00399 }
00400
00401 #ifdef USE_NGRAM
00402 j_printf("\t factoring score: ");
00403 #ifdef UNIGRAM_FACTORING
00404 j_printf("1-gram prob. (statically assigned beforehand)\n");
00405 #else
00406 j_printf("2-gram prob. (dynamically computed while search)\n");
00407 #endif
00408 #endif
00409
00410 if (align_result_word_flag) {
00411 j_printf("\t output word alignments\n");
00412 }
00413 if (align_result_phoneme_flag) {
00414 j_printf("\t output phoneme alignments\n");
00415 }
00416 if (align_result_state_flag) {
00417 j_printf("\t output state alignments\n");
00418 }
00419 #ifdef USE_DFA
00420 if (looktrellis_flag) {
00421 j_printf("\t only words in backtrellis will be expanded in 2nd pass\n");
00422 } else {
00423 j_printf("\t all possible words will be expanded in 2nd pass\n");
00424 }
00425 #endif
00426 #ifdef CATEGORY_TREE
00427 if (old_tree_function_flag) {
00428 j_printf("\t build_wchmm() used\n");
00429 } else {
00430 j_printf("\t build_wchmm2() used\n");
00431 }
00432 #ifdef PASS1_IWCD
00433 if (old_iwcd_flag) {
00434 j_printf("\t full lcdset used\n");
00435 } else {
00436 j_printf("\t lcdset limited by word-pair constraint\n");
00437 }
00438 #endif
00439 #endif
00440 if (progout_flag) j_printf("\tprogressive output on 1st pass\n");
00441
00442
00443
00444 if (compute_only_1pass) {
00445 j_printf("\tCompute only 1-pass\n");
00446 }
00447 #ifdef CONFIDENCE_MEASURE
00448 j_printf("\t output word confidence measure ");
00449 #ifdef CM_NBEST
00450 j_printf("based on N-best candidates\n");
00451 #endif
00452 #ifdef CM_SEARCH
00453 j_printf("based on search-time scores\n");
00454 #endif
00455 #endif
00456
00457 #ifdef GRAPHOUT
00458 j_printf("\nGraph output:\n");
00459 j_printf("\t(-graphrange) margin = %d frames", graph_merge_neighbor_range);
00460 if (graph_merge_neighbor_range < 0) {
00461 j_printf(" (all post-marging disabled)\n");
00462 } else if (graph_merge_neighbor_range == 0) {
00463 j_printf(" (merge same word with the same boundary)\n");
00464 } else {
00465 j_printf(" (merge same words around this margin)\n");
00466 }
00467 #ifdef GRAPHOUT_DEPTHCUT
00468 j_printf("\t(-graphcut)cutoff depth = ");
00469 if (graphout_cut_depth < 0) {
00470 j_printf("disabled (-1)\n");
00471 } else {
00472 j_printf("%d words\n",graphout_cut_depth);
00473 }
00474 #endif
00475 #ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP
00476 j_printf("\t(-graphboundloop)loopmax= %d for boundary adjustment\n",graphout_limit_boundary_loop_num);
00477 #endif
00478 #ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION
00479 j_printf("\tInhibit graph search termination before 1st sentence found = ");
00480 if (graphout_search_delay) {
00481 j_printf("enabled\n");
00482 } else {
00483 j_printf("disabled\n");
00484 }
00485 #endif
00486 #endif
00487
00488 j_printf("\nSystem I/O configuration:\n");
00489 j_printf("\t speech input source = ");
00490 if (speech_input == SP_RAWFILE) {
00491 j_printf("speech file\n");
00492 j_printf("\t input filelist = ");
00493 if (inputlist_filename == NULL) {
00494 j_printf("(none, enter filenames from stdin)\n");
00495 } else {
00496 j_printf("%s\n", inputlist_filename);
00497 }
00498 } else if (speech_input == SP_MFCFILE) {
00499 j_printf("MFCC parameter file (HTK format)\n");
00500 j_printf("\t filelist = ");
00501 if (inputlist_filename == NULL) {
00502 j_printf("(none, enter filenames from stdin)\n");
00503 } else {
00504 j_printf("%s\n", inputlist_filename);
00505 }
00506 } else if (speech_input == SP_STDIN) {
00507 j_printf("standard input\n");
00508 } else if (speech_input == SP_ADINNET) {
00509 j_printf("adinnet client\n");
00510 #ifdef USE_NETAUDIO
00511 } else if (speech_input == SP_NETAUDIO) {
00512 char *p;
00513 j_printf("NetAudio server on ");
00514 if (netaudio_devname != NULL) {
00515 j_printf("%s\n", netaudio_devname);
00516 } else if ((p = getenv("AUDIO_DEVICE")) != NULL) {
00517 j_printf("%s\n", p);
00518 } else {
00519 j_printf("local port\n");
00520 }
00521 #endif
00522 } else if (speech_input == SP_MIC) {
00523 j_printf("microphone\n");
00524 }
00525 if (speech_input != SP_MFCFILE) {
00526 if (speech_input == SP_RAWFILE || speech_input == SP_STDIN || speech_input == SP_ADINNET) {
00527 j_printf("\t sampling freq. = %d Hz required\n", para.smp_freq);
00528 } else {
00529 j_printf("\t sampling freq. = %d Hz\n", para.smp_freq);
00530 }
00531 }
00532 if (speech_input != SP_MFCFILE) {
00533 j_printf("\t threaded A/D-in = ");
00534 #ifdef HAVE_PTHREAD
00535 if (query_thread_on()) {
00536 j_printf("supported, on\n");
00537 } else {
00538 j_printf("supported, off\n");
00539 }
00540 #else
00541 j_printf("not supported (live input may be dropped)\n");
00542 #endif
00543 }
00544 if (strip_zero_sample) {
00545 j_printf("\t zero frames stripping = on\n");
00546 } else {
00547 j_printf("\t zero frames stripping = off\n");
00548 }
00549 if (speech_input != SP_MFCFILE) {
00550 if (query_segment_on()) {
00551 j_printf("\t silence cutting = on\n");
00552 j_printf("\t level thres = %d / 32767\n", level_thres);
00553 j_printf("\t zerocross thres = %d / sec.\n", zero_cross_num);
00554 j_printf("\t head margin = %d msec.\n", head_margin_msec);
00555 j_printf("\t tail margin = %d msec.\n", tail_margin_msec);
00556 } else {
00557 j_printf("\t silence cutting = off\n");
00558 }
00559 if (use_zmean || para.zmeanframe) {
00560 j_printf("\t remove DC offset = on");
00561 if (para.zmeanframe) {
00562 j_printf(" (frame-wise)\n");
00563 }
00564 if (speech_input == SP_RAWFILE) {
00565 j_printf(" (will compute for each file)\n");
00566 } else {
00567 j_printf(" (will compute from first %.1f sec)\n",
00568 (float)ZMEANSAMPLES / (float)para.smp_freq);
00569 }
00570 } else {
00571 j_printf("\t remove DC offset = off\n");
00572 }
00573 }
00574 j_printf("\t reject short input = ");
00575 if (rejectshortlen > 0) {
00576 j_printf("< %d msec\n", rejectshortlen);
00577 } else {
00578 j_printf("off\n");
00579 }
00580 #ifdef SP_BREAK_CURRENT_FRAME
00581 j_printf("\tshort pause segmentation= on\n");
00582 j_printf("\t sp duration length = %d frames\n", sp_frame_duration);
00583 #else
00584 j_printf("\tshort pause segmentation= off\n");
00585 #endif
00586 j_printf("\t result output to = ");
00587 switch(result_output) {
00588 case SP_RESULT_TTY:
00589 j_printf("tty (standard out)\n"); break;
00590 case SP_RESULT_MSOCK:
00591 j_printf("msock\n"); break;
00592 }
00593 if (progout_flag) {
00594 j_printf("\t progout interval = %d msec\n", progout_interval);
00595 }
00596 if (speech_input != SP_MFCFILE) {
00597 if (record_dirname != NULL) {
00598 j_printf("\tspeech data stored to = %s/\n", record_dirname);
00599 }
00600 }
00601 j_printf("\t output charset conv. = ");
00602 #ifdef CHARACTER_CONVERSION
00603 if (to_code == NULL) {
00604 j_printf("disabled\n");
00605 } else {
00606 if (from_code != NULL) {
00607 j_printf("from \"%s\" ", from_code);
00608 }
00609 j_printf("to \"%s\"\n", to_code);
00610 }
00611 #else
00612 j_printf("not supported\n");
00613 #endif
00614 j_printf("\n------------- System Info end -------------\n");
00615
00616 #ifdef USE_MIC
00617 if (realtime_flag) {
00618 if (para.cmn) {
00619 if (cmn_loaded) {
00620 j_printf("\ninitial CMN parameter loaded from file\n");
00621 } else {
00622 j_printf("\n");
00623 j_printf("\t*************************************************************\n");
00624 j_printf("\t* NOTICE: The first input may not be recognized, since *\n");
00625 j_printf("\t* no initial CMN parameter is available on startup. *\n");
00626 j_printf("\t*************************************************************\n");
00627 }
00628 }
00629 if (para.energy && para.enormal) {
00630 j_printf("\t*************************************************************\n");
00631 j_printf("\t* NOTICE: Energy normalization is activated on live input: *\n");
00632 j_printf("\t* maximum energy of LAST INPUT will be used for it. *\n");
00633 j_printf("\t* So, the first input will not be recognized. *\n");
00634 j_printf("\t*************************************************************\n");
00635 }
00636 }
00637 #endif
00638 }