quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_pr.a #include <HiddenMarkovModel.h> HiddenMarkovModel(); boolean setParamFile(const Filename& arg); boolean setVerify(boolean verify); boolean run(Sdb& sdb);
description:HiddenMarkovModel hmm; hmm.setParamFile(L"diagnose_params.sof"); Sdb raw_list_sdb; boolean is_list = true; raw_list_sdb.append(L"diagnose_mfcc_list.sof", is_list); hmm.run(sdb);
static const String CLASS_NAME;
enum ALGORITHM { DECODE = 0, TRAIN, INITIALIZE, MIXTURE_SPLITTING, CONTEXT_GENERATION, TRAIN_PARAMETER_TYING, TEST_PARAMETER_TYING, FORCED_ALIGNMENT, MLLR, MAP,SYMBOL_GRAPH_GENERATION, SYMBOL_GRAPH_RESCORING, NBEST_GENERATION, DEF_ALGORITHM = DECODE };
enum IMPLEMENTATION { VITERBI = 0, STACK, BAUM_WELCH, GLOBAL, VARIANCE_SPLITTING, SYMBOL_GENERATION, ML, MODEL_GENERATION, WORD_DEPENDENT_NBEST, VITERBI_NBEST, RESCORE_ACOUSTIC, RESCORE_LANGUAGE, RESCORE_BOTH, DEF_IMPLEMENTATION = VITERBI };
enum CONTEXT_MODE { SYMBOL_ONLY = 0, SYMBOL_INTERNAL, CROSS_SYMBOL, DEF_CONTEXT_MODE = SYMBOL_ONLY };
enum FUNCTION_MODE { NONE = 0, GRAMMAR_DECODING, NETWORK_DECODING, ACCUMULATE, UPDATE, DEF_FUNCTION_MODE = NONE };
enum MODE { FILE = 0, TRANSFORM, LIST, DEF_MODE = DATABASE };
enum UPDATE_MODE { TRANSITIONS = 0, OBSERVATIONS, ALL, DEF_UPDATE_MODE = ALL };
enum FORMAT { NIST_SCORE = 0, NATIVE, JSGF, DEF_FORMAT = NATIVE };
enum TYPE { TEXT = 0, BINARY, DEF_TYPE = BINARY };
static const NameMap IMPL_MAP;
static const NameMap ALGO_MAP;
static const NameMap CONTEXT_MODE_MAP;
static const NameMap FUNCTION_MODE_MAP;
static const NameMap MODE_MAP;
static const NameMap FORMAT_MAP;
static const NameMap TYPE_MAP;
static const NameMap UPDATE_MODE_MAP;
static const String DEF_PARAM;
static const String PARAM_UPDATE_LEVELS;
static const String PARAM_NUM_MIXTURES;
static const String PARAM_NUM_ITERATIONS;
static const String PARAM_VAR_FLOOR;
static const String PARAM_VAR_FLOOR_FILE;
static const String PARAM_BETA_THRESHOLD;
static const String PARAM_TRANSCRIPTION_LEVEL;
static const String PARAM_SYMBOL_GRAPH_LEVEL;
static const String PARAM_FORCE_ALIGNMENT_LEVEL;
static const String PARAM_TRANS_DB;
static const String PARAM_AUDIO_DB;
static const String PARAM_SYMBOL_GRAPH_DB;
static const String PARAM_MIN_MPD;
static const String PARAM_MIN_OCCUPANCY;
static const String PARAM_MIN_MODEL_COUNT;
static const String PARAM_ALGORITHM;
static const String PARAM_IMPLEMENTATION;
static const String PARAM_NBEST_PATHS;
static const String PARAM_MAX_NBEST_PATHS;
static const String PARAM_NBEST_BEAM;
static const String PARAM_CONFIGURATION;
static const String PARAM_FRONT_END;
static const String PARAM_LANGUAGE_MODEL;
static const String PARAM_STATISTICAL_MODEL_POOL;
static const String PARAM_UPDATE_LANGUAGE_MODEL;
static const String PARAM_UPDATE_STATISTICAL_MODEL_POOL;
static const String PARAM_ACCUMULATOR;
static const String PARAM_ACCUMULATOR_LIST;
static const String PARAM_ALIGNMENT_LEVEL;
static const String PARAM_INITIAL_LEVEL;
static const String PARAM_OUTPUT_MODE;
static const String PARAM_OUTPUT_FORMAT;
static const String PARAM_UPDATE_MODE;
static const String PARAM_FUNCTION_MODE;
static const String PARAM_CONTEXT_MODE;
static const String PARAM_CONTEXT_LEVEL;
static const String PARAM_CONTEXT_ORDER;
static const String PARAM_OUTPUT_FILE;
static const String PARAM_OUTPUT_LIST;
static const String PARAM_CONTEXT_LIST;
static const String PARAM_QUES_ANS;
static const String PARAM_PHONETIC_DT;
static const String PARAM_PHONETIC_DT_SPLIT_THRESHOLD;
static const String PARAM_PHONETIC_DT_MERGE_THRESHOLD;
static const String PARAM_PHONETIC_DT_NUM_OCC_THRESHOLD;
static const String PARAM_MLLR;
static const String OPTION_MODE_FILE;
static const String OPTION_MODE_TRANSFORM;
static const String OPTION_MODE_LIST;
static const String OPTION_FORM_NIST_SCORE;
static const String OPTION_FORM_NATIVE;
static const String OPTION_FORM_JSGF;
static const String OPTION_TRANSCRIPTION_LEVEL;
static const String OPTION_UPDATE_TRANSITIONS;
static const String OPTION_UPDATE_OBSERVATIONS;
static const String OPTION_UPDATE_ALL;
static const String OPTION_FUNCTION_NONE;
static const String OPTION_FUNCTION_GRAMMAR_DECODING;
static const String OPTION_FUNCTION_NETWORK_DECODING;
static const String OPTION_FUNCTION_ACCUMULATE;
static const String OPTION_FUNCTION_UPDATE;
static const byte OFF = 0;
static const byte ON = 1;
static const float DEF_WEIGTH_ONE = 0;
static const float DEF_WEIGTH_HALF = -0.693147;
static const float DEF_BETA_PRUNING_THRESHOLD = 3.40282347e+38F;
static const boolean DEF_VERIFY = false;
static const boolean DEF_STREAM = false;
static const long DEF_NBEST_PATHS = 10;
static const long DEF_MAX_NBEST_PATHS = 50;
static const long DEF_NBEST_BEAM = 100;
static const long DEF_NUM_LEVELS = 3;
static const long DEF_LEX_TREE_LEVEL = -1;
static const long DEF_NUM_MIXTURES = 1;
static const long DEF_NUM_ITERATIONS = 1;
static const long DEF_ALIGNMENT_LEVEL = -1;
static const long DEF_INITIAL_LEVEL = 0;
static const long DEF_CONTEXT_LEVEL = 0;
static const long DEF_CONTEXT_ORDER = 3;
static const long DEF_CAPACITY = 12000;
static const float DEF_MIN_MPD = 1000;
static const float DEF_MIN_OCCUPANCY = 1.0e-10;
static const float DEF_MIN_MODEL_COUNT = 1;
static const float DEF_VAR_FLOOR = 2e-4;
static const long ERR = (long)100000;
static const long ERR = (long)100050;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
CONTEXT_MODE context_mode_d;
FUNCTION_MODE function_mode_d;
MODE output_mode_d;
String output_levels_str_d;
Vectoroutput_levels_d;
UPDATE_MODE update_mode_d;
FORMAT output_format_d;
TYPE output_type_d;
Filename param_file_d;
Filename alignment_file_d;
Filename lm_file_d;
Filename smp_file_d;
Filename cnfg_file_d;
Filename fend_file_d;
Filename update_lm_file_d;
Filename update_smp_file_d;
Filename transcription_db_file_d;
Filename audio_db_file_d;
Filename symbol_graph_db_file_d;
Filename output_file_d;
Filename accum_file_d;
Filename accum_list_d;
Filename accum_path_d;
Filename accum_name_d;
Filename output_list_d;
Filename context_list_d;
Filename variance_floor_file_d;
Filename ques_ans_file_d;
Filename phonetic_dt_file_d;
Float phonetic_dt_split_threshold_d;
Float phonetic_dt_merge_threshold_d;
Float phonetic_dt_num_occ_threshold_d;
Float variance_floor_d;
Float beta_threshold_d;
String transcription_level_d;
String symbol_graph_level_d;
Long alignment_level_d;
Long initial_level_d;
Long context_level_d;
Long context_order_d;
Long nbest_paths_d;
Long max_nbest_paths_d;Long nbest_beam_d;
boolean stream_d;
boolean verify_d;
Vectorlt&;FrontEnd> vector_fe_d;
HashTable<Accumulator, Double> accumulator_d;
HashTable<HashKey<GraphVertex<SearchNode> >, Ulong> mapping_d;
BiGraph<TrainNode>* trellis_d;
HierarchicalSearch search_engine_d;
LanguageModel lm_d;
StackSearch stack_engine_d;
Long num_levels_d;
Long lex_tree_level_d;
Long num_mixtures_d;
VectorByte update_levels_d;
Long num_iterations_d;
Float min_mpd_d;
Float min_occupancy_d;
Long min_model_count_d;
TranscriptionDatabase transcription_db_d;
AudioDatabase audio_db_d;
MaximumLikelihoodLinearRegression mllr_d;
SymbolGraphDatabase symbol_graph_db_d;
static Integral::DEBUG debug_level_d;
static Integral::DEBUG verbosity_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean setDebug(Integral::DEBUG debug_level);
~HiddenMarkovModel();
HiddenMarkovModel();
HiddenMarkovModel(const HiddenMarkovModel& arg);
boolean assign(const HiddenMarkovModel& arg);
not present.
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& param = DEF_PARAM) const;
not present.
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
ALGORITHM getAlgorithm();
boolean setAlgorithm(ALGORITHM arg);
IMPLEMENTATION getImplementation();
boolean setImplementation(IMPLEMENTATION arg);
CONTEXT_MODE getContextMode();
boolean setContextMode(CONTEXT_MODE arg);
boolean setFunctionMode(const String& arg);
FUNCTION_MODE getFunctionMode();
boolean setOutputMode(const String& arg);
MODE getOutputMode();
boolean setOutputType(const String& arg);
Type getOutputType();
boolean setUpdateMode(const String& arg);
UPDATE_MODE getUpdateMode();
boolean setOutputFormat(const String& arg);
FORMAT getOutputFormat();
boolean setOutputLevelString(const String& arg);
boolean setUpdateLevelString(const String& arg);
boolean setAccumulatorPath(const Filename& arg);
boolean setAccumulatorName(const String& arg);
boolean getStream();
boolean setStream(boolean arg);
Filename& getParamFile();
boolean setParamFile(const Filename& arg);
Filename& getAlignmentFile();
boolean setAlignmentFile(const Filename& arg);
Filename& getLanguageModelFile();
boolean setLanguageModelFile(const Filename& arg);
Filename& getStatisticalModelPoolFile();
boolean setStatisticalModelPoolFile(const Filename& arg);
Filename& getConfigFile();
boolean setConfigFile(const Filename& arg);
Filename& getFrontEndFile();
boolean setFrontEndFile(const Filename& arg);
Filename& getLanguageModelUpdateFile();
boolean setLanguageModelUpdateFile(const Filename& arg);
Filename& getStatisticalModelPoolUpdateFile();
boolean setStatisticalModelPoolUpdateFile(const Filename& arg);
Filename& getAccumulatorFile();
boolean setAccumulatorFile(const Filename& arg);
Filename& getAccumulatorList();
boolean setAccumulatorList(const Filename& arg);
Filename& getOutputFile();
boolean setOutputFile(const Filename& arg);
Filename& getOutputList();
boolean setOutputList(const Filename& arg);
Filename& getContextList();
boolean setContextList(const Filename& arg);
Filename& getVarianceFloorFile();
boolean setVarianceFloorFile(const Filename& arg);
float getVarianceFloor();
boolean setVarianceFloor(float arg);
float getBetaThreshold();
boolean setBetaThreshold(float arg);
long getNumMixtures();
boolean setNumMixtures(long arg);
long getNumIterations();
boolean setNumIterations(long arg);
float getMinProbabilityDeviance();
boolean setMinProbabilityDeviance(float arg);
float getMinOccupancy();
boolean setMinOccupancy(float arg);
long getMinModelCount();
boolean setMinModelCount(long arg);
boolean loadAccumulators(Sdb& sdb);
boolean storeAccumulators();
boolean accumulate(float utter_prob, Vector<VectorFloat>& data);
boolean accumulateStateTransTrace(float utter_prob, Vector<VectorFloat>& data);
boolean accumulateStateTransInstance(float utter_prob, Vector<VectorFloat>& data);
boolean accumulateStatModels(float utter_prob, Vector<VectorFloat>& data);
boolean update();
boolean updateStateTrans(SearchLevel& search_level);
boolean updateStatModels(SearchLevel& search_level);
boolean adapt(Vector<StatisticalModel>& stat_models_a);
boolean insertNonSpeechSymbols(Vector<SearchSymbol>& boundary_symbols, Vector<SearchSymbol>& internal_symbols,DiGraph<SearchNode>& graph, SearchLevel& level);
boolean initTranscription(String& id, long arg);
boolean initSymbolGraph(Filename& symbol_graph_file);
boolean computeUtterProb(double& utter_prob);
boolean nonLinearDecoder(Sdb& sdb);
boolean grammarDecoder(Sdb& sdb);
boolean networkDecoder(Sdb& sdb);
boolean linearDecoder(Sdb& sdb);
boolean parameterTying(Sdb& sdb);
boolean parameterTyingTrain();
boolean parameterTyingTest();
boolean loadOccupancies();
long getInitialLevel();
boolean setInitialLevel(long arg);
long getAlignmentLevel();
boolean setAlignmentLevel(long arg);
long getContextLevel();
boolean setContextLevel(long arg);
long getContextOrder();
boolean setContextOrder(long arg);
long getNumLevels();
boolean setNumLevels(long arg);
long getNumLexicalTreeLevels();
boolean setNumLexicalTreeLevels(long arg);
boolean setVerbosity(Integral::DEBUG verbosity);
boolean setVerify(boolean verify);
boolean run(Sdb& sdb);
boolean checkParams();
boolean load();
boolean store();
boolean initialize(Sdb& sdb);
boolean extractFeatures(long fe_index, Vector<VectorFloat>& data);
boolean initializeMappingTable();
boolean agToDigraph(DiGraph<SearchNode>& digraph, AnnotationGraph& ag, long& channel, float& start_time, float& stop_time, boolean& is_conversation);
boolean agToSegment(AnnotationGraph& ag, long& channel, float& start_time, float& stop_time);
boolean resetAccumulators();
boolean createAnnotationGraph(AnnotationGraph& anno_a, DoubleLinkedList<Trace>& trace_path_a);
boolean createAnnotationGraph(AnnotationGraph& anno_a, DoubleLinkedList<Instance>& instance_path_a);
boolean pruneAnnotationGraph(AnnotationGraph& anno_a);
boolean parseLevels(const String& output_levels_str, VectorByte& output_levels);
boolean setVector(const String& source, VectorByte& vector);
boolean setOutputLevels(const String& source, Vector<Long>& vector);
boolean insert(VectorByte& src, long start_index, long num_elem, byte mode);
boolean createContexts(Vector<SearchSymbol>& symbols, long order, Vector<SearchSymbol>& all_contexts);
boolean appendContexts(Vector<SearchSymbol>& symbols, SearchSymbol symbol_a, long curr_order, long order, Vector<SearchSymbol>& all_contexts);
boolean writeNBest(Filename& output_file_name, NBestPath* final_plist, SymbolGraphNode* start_node);
boolean adaptPart(Vector<MatrixDouble>& g_a, MatrixFloat& z_a, GaussianModel& gm_a);
// declare a HiddenMarkovModel object // HiddenMarkovModel hmm; // set up the param file for hmm and front end specification // hmm.setParamFile(L"diagnose_params.sof"); // setup the input speech file list // Sdb raw_list_sdb; boolean is_list = true; raw_list_sdb.append(L"diagnose_raw_list.sof", is_list); // run the HiddenMarkovModel recongizer on the input speech file list // hmm.run(raw_list_sdb);