00001
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef __J_JCONF_H__
00040 #define __J_JCONF_H__
00041
00042 #include <sent/stddefs.h>
00043 #include <sent/hmm.h>
00044 #include <sent/vocabulary.h>
00045 #include <sent/ngram2.h>
00046 #include <sent/dfa.h>
00047 #include <sent/mfcc.h>
00048 #include <julius/wchmm.h>
00049 #include <julius/search.h>
00050 #include <julius/callback.h>
00051
00056 #define JCONF_MODULENAME_MAXLEN 64
00057
00062 #define JCONF_MODULENAME_DEFAULT "_default"
00063
00068 typedef struct __jconf_am__ {
00069
00074 short id;
00075
00080 char name[JCONF_MODULENAME_MAXLEN];
00081
00085 char *hmmfilename;
00089 char *mapfilename;
00094 int gprune_method;
00098 int mixnum_thres;
00103 char *spmodel_name;
00107 char *hmm_gs_filename;
00111 int gs_statenum;
00112
00117 short iwcdmethod;
00118
00122 short iwcdmaxn;
00123
00128 LOGPROB iwsp_penalty;
00129
00134 boolean force_multipath;
00135
00141 struct {
00145 Value para;
00149 Value para_default;
00153 Value para_hmm;
00157 Value para_htk;
00161 char *cmnload_filename;
00166 boolean cmn_update;
00170 char *cmnsave_filename;
00174 float cmn_map_weight;
00175
00176 } analysis;
00177
00178
00183 struct {
00188 float ss_alpha;
00189
00194 float ss_floor;
00195
00199 boolean sscalc;
00200
00204 int sscalc_len;
00205
00209 char *ssload_filename;
00210 } frontend;
00211
00212
00213 struct __jconf_am__ *next;
00214
00215 } JCONF_AM;
00216
00221 typedef struct __jconf_lm__ {
00222
00227 short id;
00228
00233 char name[JCONF_MODULENAME_MAXLEN];
00234
00239 int lmtype;
00240
00246 int lmvar;
00247
00251 char *dictfilename;
00252
00256 char *head_silname;
00260 char *tail_silname;
00261
00265 boolean forcedict_flag;
00266
00270 char *ngram_filename;
00274 char *ngram_filename_lr_arpa;
00278 char *ngram_filename_rl_arpa;
00279
00283 char *dfa_filename;
00284
00288 GRAMLIST *gramlist_root;
00289
00293 GRAMLIST *wordlist_root;
00294
00299 boolean enable_iwsp;
00300
00305 boolean enable_iwspword;
00309 char *iwspentry;
00310
00311 #ifdef SEPARATE_BY_UNIGRAM
00312
00316 int separate_wnum;
00317 #endif
00318
00322 char wordrecog_head_silence_model_name[MAX_HMMNAME_LEN];
00326 char wordrecog_tail_silence_model_name[MAX_HMMNAME_LEN];
00330 char wordrecog_silence_context_name[MAX_HMMNAME_LEN];
00331
00336 struct __jconf_lm__ *next;
00337
00338 } JCONF_LM;
00339
00344 typedef struct __jconf_search__ {
00345
00350 short id;
00351
00356 char name[JCONF_MODULENAME_MAXLEN];
00357
00362 JCONF_AM *amconf;
00363
00368 JCONF_LM *lmconf;
00369
00373 boolean compute_only_1pass;
00374
00378 boolean ccd_handling;
00379
00383 boolean force_ccd_handling;
00384
00389 struct {
00393 LOGPROB lm_weight;
00397 LOGPROB lm_penalty;
00401 LOGPROB lm_weight2;
00405 LOGPROB lm_penalty2;
00409 LOGPROB lm_penalty_trans;
00410
00414 LOGPROB penalty1;
00418 LOGPROB penalty2;
00419
00423 boolean lmp2_specified;
00424
00428 boolean lmp_specified;
00429 } lmp;
00430
00435 struct {
00441 int specified_trellis_beam_width;
00442
00443 #if defined(WPAIR) && defined(WPAIR_KEEP_NLIMIT)
00444
00447 int wpair_keep_nlimit;
00448 #endif
00449
00450 #ifdef HASH_CACHE_IW
00451
00454 int iw_cache_rate;
00455 #endif
00456
00461 boolean old_tree_function_flag;
00462
00463 #ifdef DETERMINE
00464
00469 LOGPROB determine_score_thres;
00470
00475 int determine_duration_thres;
00476
00477 #endif
00478
00479
00480 } pass1;
00481
00486 struct {
00490 int nbest;
00494 int enveloped_bestfirst_width;
00495 #ifdef SCAN_BEAM
00496
00499 LOGPROB scan_beam_thres;
00500 #endif
00501
00504 int hypo_overflow;
00508 int stack_size;
00513 int lookup_range;
00514
00519 boolean looktrellis_flag;
00520
00521 } pass2;
00522
00527 struct {
00528
00533 boolean enabled;
00534
00539 boolean lattice;
00540
00545 boolean confnet;
00546
00552 int graph_merge_neighbor_range;
00553
00554 #ifdef GRAPHOUT_DEPTHCUT
00555
00559 int graphout_cut_depth;
00560 #endif
00561
00562 #ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP
00563
00567 int graphout_limit_boundary_loop_num;
00568 #endif
00569
00570 #ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION
00571
00576 boolean graphout_search_delay;
00577 #endif
00578
00579 } graph;
00580
00585 struct {
00586
00591 boolean enabled;
00592
00596 int sp_frame_duration;
00597
00602 char *pausemodelname;
00603
00604 #ifdef SPSEGMENT_NAIST
00605
00610 int sp_margin;
00611
00617 int sp_delay;
00618 #endif
00619
00620 } successive;
00621
00622
00627 struct {
00628
00629 #ifdef CONFIDENCE_MEASURE
00630
00633 LOGPROB cm_alpha;
00634
00635 #ifdef CM_MULTIPLE_ALPHA
00636
00639 LOGPROB cm_alpha_bgn;
00643 LOGPROB cm_alpha_end;
00647 int cm_alpha_num;
00651 LOGPROB cm_alpha_step;
00652 #endif
00653
00654 #ifdef CM_SEARCH_LIMIT
00655
00658 LOGPROB cm_cut_thres;
00659 #endif
00660
00661 #ifdef CM_SEARCH_LIMIT_POPO
00662
00665 LOGPROB cm_cut_thres_pop;
00666 #endif
00667
00668 #endif
00669
00670
00674 boolean align_result_word_flag;
00678 boolean align_result_phoneme_flag;
00682 boolean align_result_state_flag;
00683
00684 } annotate;
00685
00690 struct {
00694 int output_hypo_maxnum;
00698 boolean progout_flag;
00702 int progout_interval;
00706 int progout_interval_frame;
00707
00712 boolean multigramout_flag;
00713
00714 } output;
00715
00720 struct {
00724 boolean trellis_check_flag;
00728 boolean triphone_check_flag;
00732 boolean wchmm_check_flag;
00738 boolean start_inactive;
00739
00740 } sw;
00741
00742
00743 struct __jconf_search__ *next;
00744
00745 } JCONF_SEARCH;
00746
00751 typedef struct __Jconf__ {
00752
00756 struct {
00757
00762 int speech_input;
00767 long sfreq;
00772 long period;
00777 int framesize;
00782 int frameshift;
00783
00787 boolean use_ds48to16;
00791 char *inputlist_filename;
00795 int adinnet_port;
00796 #ifdef USE_NETAUDIO
00797
00800 char *netaudio_devname;
00801 #endif
00802
00806 boolean paramtype_check_flag;
00807
00808 } input;
00809
00814 struct {
00818 int level_thres;
00822 int head_margin_msec;
00826 int tail_margin_msec;
00830 int zero_cross_num;
00835 int silence_cut;
00836 #ifdef GMM_VAD
00837
00841 int gmm_margin;
00842 #endif
00843 } detect;
00844
00849 struct {
00850
00854 boolean strip_zero_sample;
00855
00859 boolean use_zmean;
00860
00861 } preprocess;
00862
00867 struct {
00871 char *gmm_filename;
00875 int gmm_gprune_num;
00879 char *gmm_reject_cmn_string;
00883 int rejectshortlen;
00884 #ifdef POWER_REJECT
00885
00889 float powerthres;
00890 #endif
00891 } reject;
00892
00897 struct {
00902 boolean realtime_flag;
00903
00909 boolean force_realtime_flag;
00910
00915 boolean forced_realtime;
00916
00921 boolean segment;
00922
00923 } decodeopt;
00924
00930 JCONF_AM *am_root;
00931
00936 JCONF_LM *lm_root;
00937
00943 JCONF_SEARCH *search_root;
00944
00949 JCONF_LM *lmnow;
00954 JCONF_AM *amnow;
00959 JCONF_SEARCH *searchnow;
00960
00966 JCONF_AM *gmm;
00967
00968 } Jconf;
00969
00970 #endif
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123