def save_results(params: AttributeDict, test_set_name: str, results_dict: Dict[(str, List[Tuple[(List[int], List[int])]])]):
    if (params.method == 'attention-decoder'):
        enable_log = False
    else:
        enable_log = True
    test_set_wers = dict()
    for (key, results) in results_dict.items():
        recog_path = (params.exp_dir / f'recogs-{test_set_name}-{key}.txt')
        store_transcripts(filename=recog_path, texts=results)
        if enable_log:
            logging.info(f'The transcripts are stored in {recog_path}')
        errs_filename = (params.exp_dir / f'errs-{test_set_name}-{key}.txt')
        with open(errs_filename, 'w') as f:
            wer = write_error_stats(f, f'{test_set_name}-{key}', results, enable_log=enable_log)
            test_set_wers[key] = wer
        if enable_log:
            logging.info('Wrote detailed error stats to {}'.format(errs_filename))
    test_set_wers = sorted(test_set_wers.items(), key=(lambda x: x[1]))
    errs_info = (params.exp_dir / f'wer-summary-{test_set_name}.txt')
    with open(errs_info, 'w') as f:
        print('settings\tWER', file=f)
        for (key, val) in test_set_wers:
            print('{}\t{}'.format(key, val), file=f)
    s = '\nFor {}, WER of different settings are:\n'.format(test_set_name)
    note = '\tbest for {}'.format(test_set_name)
    for (key, val) in test_set_wers:
        s += '{}\t{}{}\n'.format(key, val, note)
        note = ''
    logging.info(s)
def save_results(params: AttributeDict, test_set_name: str, results_dict: Dict[(str, List[Tuple[(List[int], List[int])]])]):
    if (params.method == 'attention-decoder'):
        enable_log = False
    else:
        enable_log = True
    test_set_wers = dict()
    for (key, results) in results_dict.items():
        recog_path = (params.exp_dir / f'recogs-{test_set_name}-{key}.txt')
        store_transcripts(filename=recog_path, texts=results)
        if enable_log:
            logging.info(f'The transcripts are stored in {recog_path}')
        errs_filename = (params.exp_dir / f'errs-{test_set_name}-{key}.txt')
        with open(errs_filename, 'w') as f:
            wer = write_error_stats(f, f'{test_set_name}-{key}', results, enable_log=enable_log)
            test_set_wers[key] = wer
        if enable_log:
            logging.info('Wrote detailed error stats to {}'.format(errs_filename))
    test_set_wers = sorted(test_set_wers.items(), key=(lambda x: x[1]))
    errs_info = (params.exp_dir / f'wer-summary-{test_set_name}.txt')
    with open(errs_info, 'w') as f:
        print('settings\tWER', file=f)
        for (key, val) in test_set_wers:
            print('{}\t{}'.format(key, val), file=f)
    s = '\nFor {}, WER of different settings are:\n'.format(test_set_name)
    note = '\tbest for {}'.format(test_set_name)
    for (key, val) in test_set_wers:
        s += '{}\t{}{}\n'.format(key, val, note)
        note = 
    logging.info(s)