import os
from tqdm import tqdm

for MUL in tqdm([0.1, 1], 'Multiplicator'):
    for MODEL_TYPE in tqdm(['no_reny', 'baseline', 'reny_1_3' ,'reny_1_5', 'reny_1_8'], 'Model Type'):
        print(MODEL_TYPE,MUL)
        file_name = 'style_emb_lambda_{}_very_new_sent_{}_128_3_no_reset_128_90000'.format(MUL, MODEL_TYPE)
        print(file_name)
        with open(os.path.join('sentences_new', file_name, 'golden_True.txt'), 'r') as file:
            golden_sentences = file.readlines()
        golden_sentences = [i.replace('\n','') for i in golden_sentences]
        print(file_name)
        with open(os.path.join('sentences_new', file_name, 'gen_True.txt'), 'r') as file:
            generated_sentences = file.readlines()
        generated_sentences = [i.replace('\n','') for i in generated_sentences]
        print(file_name)
        with open(os.path.join('sentences_new', file_name, 'golden_True.txt'), 'r') as file:
            labels_label = file.readlines()
        labels_label = [i.replace('\n','') for i in labels_label]

        with open('sentiment.test.0.{}_{}'.format(MODEL_TYPE, MUL), 'w') as file:
            for i in range(len(golden_sentences) // 2):
                file.writelines('{}\t{}\t{}\n'.format(golden_sentences[i], generated_sentences[i], labels_label[i]))

        with open('sentiment.test.1.{}_{}'.format(MODEL_TYPE, MUL), 'w') as file:
            for i in range(len(golden_sentences) // 2):
                file.writelines('{}\t{}\t{}\n'.format(golden_sentences[len(golden_sentences) // 2 + i],
                                                      generated_sentences[len(golden_sentences) // 2 + i],
                                                      labels_label[len(golden_sentences) // 2 + i]))
