예제 #1
0
                           'speaker_name_width'))
        max_speaker_name_width = max(corp_speaker_name_width,
                                     speaker_name_width)

        corpora.append([
            config.get("corpus" + str(cur_corpus_id), "location"),
            config.get("corpus" + str(cur_corpus_id), "prefix"),
            config.get("corpus" + str(cur_corpus_id), "word_suffix"),
            corp_speaker_name_width
        ])

        cur_corpus_id += 1

    if len(corpora) == 0: sys.exit("No Corpora Found!")

    data_manipulation.import_dictionaries(dicts)
    data_manipulation.import_corpora(corpora, max_speaker_name_width)

    mkmono0_led = 'config/mkmono0.led'
    mkmono1_led = 'config/mkmono1.led'
    # Make phone transcriptions
    if not os.path.exists(mkmono0_led): sys.exit("Not Found: " + mkmono0_led)
    if not os.path.exists(mkmono1_led): sys.exit("Not Found: " + mkmono1_led)
    if os.path.isdir('files'): shutil.rmtree('files')
    os.mkdir('files')

    excluded = []
    if config.getint('corpora', 'skip_dict_lookup') == 1:
        shutil.copyfile('corpora/words.mlf', 'files/words.mlf')
    else:
        excluded = data_manipulation.prune_transcriptions(
예제 #2
0
    parser.add_option('-q', '--queue', dest="queue", help="Fix the queue where things are running in", default="")

    options, configs = parser.parse_args()



    if len(options.recognition_dir) == 0:
        dirs_done = []
        if len(options.dirs_done) > 0:
            dirs_done = options.dirs_done.split(',')


        experiments, model = parse_config(configs)
        model.make_reference()
        if model.configuration['dict'] is not None:
            data_manipulation.import_dictionaries([(model.configuration['dict'], '', '')])
            model.configuration['dict_hdecode'] = os.getcwd() + '/dictionary/dict.hdecode'
            model.configuration['dict_hvite'] = os.getcwd() + '/dictionary/dict'
        for exp in experiments.keys():
            if exp in dirs_done:
                experiments[exp].done = True
            experiments[exp].launch_options = vars(options)
        run_experiments(experiments)
    else:
        experiments,_ = parse_config([options.recognition_dir + '/config'])
        if len(experiments) != 1:
            sys.exit("Expected exactly one experiment! (found %s)" % ', '.join(experiments.keys()))

        htk.num_tasks = options.num_tasks
        htk.default_HERest_pruning = ['300.0', '500.0', '2000.0']
        job_runner.default_options["verbosity"] = 1
예제 #3
0
if current_step >= options.step:


    logger.info("Start step: %d (%s)" % (current_step, 'Making reference trn'))
    data_manipulation.mlf_to_trn(words_mlf, 'reference.trn', speaker_name_width, ref_del_char)

dicts = []
cur_dict_id = 1
while config.has_option("dict"+str(cur_dict_id), "location"):
    dicts.append([config.get("dict"+str(cur_dict_id), "location"),
                    config.get("dict"+str(cur_dict_id), "prefix"),
                    config.get("dict"+str(cur_dict_id), "word_suffix")])
    cur_dict_id += 1

if len(dicts) > 0:
    data_manipulation.import_dictionaries(dicts)
    dict = 'dictionary/dict'
    dict_hdecode = 'dictionary/dict.hdecode'
        

baseline_dir = 'baseline'
baseline_lat_dir = baseline_dir + '/lattices.htk'
baseline_lat_dir_rescored = baseline_dir + '/lattices.rescored'
baseline_pass1_mlf = baseline_dir + '/pass1.mlf'
baseline_pass2_mlf = baseline_dir + '/pass2.mlf'

if 'baseline' in experiments:

    pass1_trn = baseline_dir + '/pass1.trn'
    pass2_trn = baseline_dir + '/pass2.trn'
예제 #4
0
                      dest="queue",
                      help="Fix the queue where things are running in",
                      default="")

    options, configs = parser.parse_args()

    if len(options.recognition_dir) == 0:
        dirs_done = []
        if len(options.dirs_done) > 0:
            dirs_done = options.dirs_done.split(',')

        experiments, model = parse_config(configs)
        model.make_reference()
        if model.configuration['dict'] is not None:
            data_manipulation.import_dictionaries([
                (model.configuration['dict'], '', '')
            ])
            model.configuration['dict_hdecode'] = os.getcwd(
            ) + '/dictionary/dict.hdecode'
            model.configuration['dict_hvite'] = os.getcwd(
            ) + '/dictionary/dict'
        for exp in experiments.keys():
            if exp in dirs_done:
                experiments[exp].done = True
            experiments[exp].launch_options = vars(options)
        run_experiments(experiments)
    else:
        experiments, _ = parse_config([options.recognition_dir + '/config'])
        if len(experiments) != 1:
            sys.exit("Expected exactly one experiment! (found %s)" %
                     ', '.join(experiments.keys()))