def rescore_all(workdir, nbestdir, config):
    for tsk in ['nbestlist_{}_{}'.format(a, b) for a in ['dt05', 'et05'] for b in ['real', 'simu']]:
        print('process ' + tsk)
        nbest_txt = nbestdir + tsk + '/words_text'
        outdir = workdir + nbestdir.split('/')[-2] + '/' + tsk + '/'
        wb.mkdir(outdir)

        write_lmscore = outdir + 'lmwt.lstm'
        lstm.rescore(workdir, nbest_txt, write_lmscore, config)