def benchmark_align_corpus(corpus_dir, dict_path, output_directory, speaker_characters, fast,
            output_model_path, num_jobs, verbose):
    beg = time.time()
    align_corpus(corpus_dir, dict_path, output_directory, speaker_characters, fast,
            output_model_path, num_jobs, verbose, False)
    end = time.time()
    return [(end - beg)]
Example #2
0
def benchmark_align_corpus(corpus_dir, dict_path, output_directory,
                           speaker_characters, fast, output_model_path,
                           num_jobs, verbose):
    beg = time.time()
    align_corpus(corpus_dir, dict_path, output_directory, speaker_characters,
                 fast, output_model_path, num_jobs, verbose, False)
    end = time.time()
    return [(end - beg)]
Example #3
0
def benchmark_align_corpus():
    beg = time.time()
    align_corpus(corpus_dir, dict_path, output_directory, temp_dir, model_path, args)
    end = time.time()
    dict_data = {'Computer': platform.node(),
                'Date': str(datetime.now()),
                'Corpus': corpus_dir,
                'Type of benchmark': 'align english',
                'Total time': end - beg,
                'Num_jobs': args.num_jobs}

    return dict_data
        self.verbose = False
        self.clean = True
        self.no_speaker_adaptation = False
        self.temp_directory = '/data/mmcauliffe/temp/MFA'

args = DummyArgs()
args.corpus_directory = '/media/share/datasets/aligner_benchmarks/sorted_quebec_french'
args.dictionary_path = '/media/share/corpora/GP_for_MFA/FR/dict/fr.dict'
args.output_directory = '/data/mmcauliffe/aligner-output/aligned_quebec_french'
args.output_model_path = '/data/mmcauliffe/aligner-models/french_qc.zip'

if not os.path.exists(args.output_model_path):
    fix_path()
    try:
        beg = time.time()
        align_corpus(args)
        end = time.time()
        duration = end - beg
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print('{} encountered an error!'.format(full_name))
        traceback.print_exception(exc_type, exc_value, exc_traceback,
                                    file=sys.stdout)
    unfix_path()

csv_columns = ['Computer','Date','Corpus', 'Version', 'Language', 'Type of benchmark', 'Total time', 'Num_jobs']

now = datetime.now()
date = str(now.year)+str(now.month)+str(now.day)

dict_data = {'Computer': platform.node(),
Example #5
0
def benchmark_align_corpus():
    beg = time.time()
    align_corpus(corpus_dir, dict_path, output_directory, temp_dir,
                 output_model_path, args)
    end = time.time()
    return [(end - beg)]
Example #6
0
        self.clean = True
        self.no_speaker_adaptation = False
        self.temp_directory = '/data/mmcauliffe/temp/MFA'


args = DummyArgs()
args.corpus_directory = '/media/share/datasets/aligner_benchmarks/sorted_quebec_french'
args.dictionary_path = '/media/share/corpora/GP_for_MFA/FR/dict/fr.dict'
args.output_directory = '/data/mmcauliffe/aligner-output/aligned_quebec_french'
args.output_model_path = '/data/mmcauliffe/aligner-models/french_qc.zip'

if not os.path.exists(args.output_model_path):
    fix_path()
    try:
        beg = time.time()
        align_corpus(args)
        end = time.time()
        duration = end - beg
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print('{} encountered an error!'.format(full_name))
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  file=sys.stdout)
    unfix_path()

csv_columns = [
    'Computer', 'Date', 'Corpus', 'Version', 'Language', 'Type of benchmark',
    'Total time', 'Num_jobs'
]
Example #7
0
def align_gp(lang_code, full_name):

    if lang_code == 'FR':
        args = DummyArgs()
        args.corpus_directory = '/media/share/corpora/GP_for_MFA/{}'.format(lang_code)
        args.dictionary_path = '/media/share/corpora/GP_for_MFA/{0}/dict/fr.dict'.format(lang_code)
        args.output_directory = '/data/mmcauliffe/aligner-output/{}'.format(lang_code)
        args.output_model_path = '/data/mmcauliffe/aligner-models/{}_prosodylab.zip'.format(full_name)
        if not os.path.exists(args.output_model_path):
            try:
                align_corpus(args)
            except Exception as e:
                exc_type, exc_value, exc_traceback = sys.exc_info()
                print('{} encountered an error!'.format(full_name))
                traceback.print_exception(exc_type, exc_value, exc_traceback,
                                            file=sys.stdout)

        args = DummyArgs()
        args.corpus_directory = '/media/share/corpora/GP_for_MFA/{}'.format(lang_code)
        args.dictionary_path = '/media/share/corpora/GP_for_MFA/{0}/dict/lexique.dict'.format(lang_code)
        args.output_directory = '/data/mmcauliffe/aligner-output/{}'.format(lang_code)
        args.output_model_path = '/data/mmcauliffe/aligner-models/{}_lexique.zip'.format(full_name)
        if not os.path.exists(args.output_model_path):
            try:
                align_corpus(args)
            except Exception as e:
                exc_type, exc_value, exc_traceback = sys.exc_info()
                print('{} encountered an error!'.format(full_name))
                traceback.print_exception(exc_type, exc_value, exc_traceback,
                                            file=sys.stdout)

    elif lang_code == 'GE':
        args = DummyArgs()
        args.corpus_directory = '/media/share/corpora/GP_for_MFA/{}'.format(lang_code)
        args.dictionary_path = '/media/share/corpora/GP_for_MFA/{0}/dict/de.dict'.format(lang_code)
        args.output_directory = '/data/mmcauliffe/aligner-output/{}'.format(lang_code)
        args.output_model_path = '/data/mmcauliffe/aligner-models/{}_prosodylab.zip'.format(full_name)
        if not os.path.exists(args.output_model_path):
            try:
                align_corpus(args)
            except Exception as e:
                exc_type, exc_value, exc_traceback = sys.exc_info()
                print('{} encountered an error!'.format(full_name))
                traceback.print_exception(exc_type, exc_value, exc_traceback,
                                            file=sys.stdout)

    args = DummyArgs()
    args.corpus_directory = '/media/share/corpora/GP_for_MFA/{}'.format(lang_code)
    args.dictionary_path = '/media/share/corpora/GP_for_MFA/{0}/dict/{0}_dictionary.txt'.format(lang_code)
    args.output_directory = '/data/mmcauliffe/aligner-output/{}'.format(lang_code)
    args.output_model_path = '/data/mmcauliffe/aligner-models/{}.zip'.format(full_name)

    if os.path.exists(args.output_model_path):
        print('skipping {}, output  model already exists'.format(full_name))
        return

    try:
        beg = time.time()
        align_corpus(args)
        end = time.time()
        duration = end - beg
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print('{} encountered an error!'.format(full_name))
        traceback.print_exception(exc_type, exc_value, exc_traceback,
                                    file=sys.stdout)
        return

    csv_columns = ['Computer','Date','Corpus', 'Version', 'Language', 'Type of benchmark', 'Total time', 'Num_jobs']

    now = datetime.now()
    date = str(now.year)+str(now.month)+str(now.day)

    dict_data = {'Computer': platform.node(),
            'Date': date,
            'Corpus': args.corpus_directory,
            'Version': aligner.__version__,
            'Language': lang_code,
            'Type of benchmark': 'train and align',
            'Total time': duration,
            'Num_jobs': args.num_jobs}



    if not os.path.exists(csv_path):
        with open(csv_path, 'a') as csv_file:
            writer = csv.DictWriter(csv_file, fieldnames=csv_columns)
            writer.writeheader()


    with open(csv_path, 'a') as csv_file:
        writer = csv.DictWriter(csv_file, fieldnames=csv_columns)
        writer.writerow(dict_data)
def benchmark_align_corpus():
    beg = time.time()
    align_corpus(corpus_dir, dict_path, output_directory, temp_dir, output_model_path, args)
    end = time.time()
    return [(end - beg)]