def __init__(self, corpus, feats_dir, am_dir, output_dir, lang_args, log=utils.logger.null_logger): super(NeuralNetwork, self).__init__(corpus, feats_dir, output_dir, lang_args, log=log) self.am_dir = os.path.abspath(am_dir) utils.check_directory(self.am_dir, ['tree', 'final.mdl', 'ali.1.gz'])
def __init__(self, corpus, feats_dir, tri_dir, output_dir, lang_args, log=utils.logger.null_logger()): super(TriphoneSpeakerAdaptive, self).__init__(corpus, feats_dir, output_dir, lang_args, log=log) self.tri_dir = os.path.abspath(tri_dir) utils.check_directory(self.tri_dir, ['final.mdl', 'ali.1.gz'])
def __init__(self, corpus, feats_dir, mono_dir, output_dir, lang_args, log=utils.logger.null_logger): super(Triphone, self).__init__(corpus, feats_dir, output_dir, lang_args, log=log) self.mono_dir = os.path.abspath(mono_dir) utils.check_directory(self.mono_dir, ['tree', 'final.mdl', 'final.occs'])
def check_acoustic_model(am_dir): """Raise IOError if final.mdl is not in am_dir""" utils.check_directory(am_dir, ['final.mdl'], name='acoustic model') utils.check_directory(os.path.join(am_dir, 'lang'), ['L.fst', 'phones.txt', 'words.txt'], name='lang') utils.check_directory(os.path.join(am_dir, 'lang', 'phones'), ['silence.csl', 'disambig.int'], name='lang/phones')
def check_language_model(lm_dir): """Raise IOError if oov.int, G.fst and G.arpa.fst are not in `lm_dir`""" utils.check_directory(lm_dir, ['oov.int', 'G.fst', 'G.arpa.gz', 'phones.txt'], name='language model')