// file: $isip_ifc/class/asr/SpeakerVerifier/SpeakerVerifier.h // version: $Id: SpeakerVerifier.h 10480 2006-03-13 21:31:40Z raghavan $ // // make sure definitions are only made once // #ifndef ISIP_SPEAKER_VERIFIER #define ISIP_SPEAKER_VERIFIER #ifndef ISIP_VERIFY_HMM #include #endif #ifndef ISIP_SUPPORT_VECTOR_MACHINE #include #endif #ifndef ISIP_RELEVANCE_VECTOR_MACHINE #include #endif #ifndef ISIP_AUDIO_DATABASE #include #endif #ifndef ISIP_FEATURE_FILE #include #endif #ifndef ISIP_STATISTICAL_MODEL #include #endif // SpeakerVerifier: a class to set up parameters of the SpeakerVerifier // system and run it // class SpeakerVerifier { //-------------------------------------------------------------------------- // // public constants // //-------------------------------------------------------------------------- public: // define the class name // static const String CLASS_NAME; // decalre constant string // static const String DEF_HMM_ALGO; static const String DEF_SVM_ALGO; static const String DEF_RVM_ALGO; //---------------------------------------- // // error codes // //---------------------------------------- static const int32 ERR = (int32)110000; // define algorithm types // enum ALGORITHM { HMM = 0, SVM, RVM, DEF_ALGORITHM = HMM }; //--------------------------------------------------------------------------- // // protected data // //--------------------------------------------------------------------------- protected: // algorithm type // ALGORITHM algorithm_d; // parameter file // Filename param_file_name_d; // Verify HMM object // VerifyHMM hmm_d; // Support Vector Machine object // SupportVectorMachine svm_d; // Relevance Vector Machine object // RelevanceVectorMachine rvm_d; // debug level // static Integral::DEBUG debug_level_d; // verbosity // static Integral::DEBUG verbosity_d; // static memory manager // static MemoryManager mgr_d; // model file // Filename model_file_d; // audio db file // Filename audio_db_file_d; // output file // Filename output_file_d; // decision threshols // Float decision_thresholds_d; //--------------------------------------------------------------------------- // // required public methods // //--------------------------------------------------------------------------- public: // method: name // static const String& name() { return CLASS_NAME; } // other static methods // static bool8 diagnose(Integral::DEBUG debug_level); // method: setDebug // bool8 setDebug(Integral::DEBUG debug_level) { debug_level_d = debug_level; return true; } // constructor(s)/destructor(s) // SpeakerVerifier(); SpeakerVerifier(const SpeakerVerifier& arg); ~SpeakerVerifier(); // assign method // bool8 assign(const SpeakerVerifier& arg); //--------------------------------------------------------------------------- // // class-specific public methods // //--------------------------------------------------------------------------- // method: setAlgorithm // bool8 setAlgorithm(String algo_type) { if (algo_type.eq(DEF_HMM_ALGO)) algorithm_d = HMM; else if (algo_type.eq(DEF_SVM_ALGO)) algorithm_d = SVM; else if (algo_type.eq(DEF_RVM_ALGO)) algorithm_d = RVM; return true; } // method: setParam // bool8 setParam(String param_file_name); // method: setVerbosity // bool8 setVerbosity(Integral::DEBUG verbosity) { verbosity_d = verbosity; return true; } // method: setModelFile // bool8 setModelFile(Filename& model_file) { model_file_d = model_file; return true; } // method: setAudioDb // bool8 setAudioDbFile(Filename& audio_db_file) { audio_db_file_d = audio_db_file; return true; } // method setOutputFile // bool8 setOutputFile(Filename& output_file) { if (output_file.length() != 0) { // svm test output file // output_file_d = output_file; return true; } return false; } // method: setDecisionThresholds // bool8 setDecisionThresholds(const String& decision_thresholds) { if ( decision_thresholds.length() != 0 ) { decision_thresholds_d.assign(decision_thresholds); return true; } return false; } //--------------------------------------------------------------------------- // // class-specific public methods: // get methods // //--------------------------------------------------------------------------- // method: getAlgorithm // ALGORITHM getAlgorithm() const { return algorithm_d; } //--------------------------------------------------------------------------- // // class-specific public methods: // computational methods // //--------------------------------------------------------------------------- // method: run // used for hmm training and testing, svm/rvm testing // bool8 run(Sdb& sdb); // method: run // used for svm/rvm training // bool8 run(Sdb& pos_sdb, Sdb& neg_sdb); //--------------------------------------------------------------------------- // // private methods // //--------------------------------------------------------------------------- private: }; //end of include file // #endif