# pre-1a with open('config.txt') as fo: text = fo.read() train_path = re.findall('TRAINING_PATH *= *(.*)', text)[0] gen_path = re.findall('CONFIG_1_GEN_PATH *= *(.*)', text)[0] parent_path = os.path.dirname(gen_path) hyp_1 = os.path.join(parent_path, '1') hyp_a = os.path.join(parent_path, '1a') hyp_b = os.path.join(parent_path, '1b') hyp_c = os.path.join(parent_path, '1c') hyp_d = os.path.join(parent_path, '1d') hyp_e = os.path.join(parent_path, '1e') # 1a + 1b generate_elements(train_path, gen_path, hyp_1) generate_tags(train_path, hyp_1, gen_path, hyp_a) copy_folder(hyp_a, hyp_b) # 1c copy_folder(hyp_b, hyp_c) generate_attributes(train_path, hyp_c, hyp_c) #1d + e copy_folder(hyp_c, hyp_d) generate_qslinks(train_path, hyp_d, hyp_d) generate_olinks(train_path, hyp_d, hyp_d) generate_movelinks(train_path, hyp_d, hyp_d) copy_folder(hyp_d, hyp_e)
import re, os from util.model.baseline_classifier import copy_folder from util.d_fill_link_attrs import generate_qslinks, generate_olinks,\ generate_movelinks from util.c_fill_tag_attrs import generate_attributes if __name__ == "__main__": with open('config.txt') as fo: text = fo.read() train_path = re.findall('TRAINING_PATH *= *(.*)', text)[0] gen_path = re.findall('CONFIG_2_GEN_PATH *= *(.*)', text)[0] parent_path = os.path.dirname(gen_path) hyp_a = os.path.join(parent_path, '2a') hyp_b = os.path.join(parent_path, '2b') hyp_c = os.path.join(parent_path, '2c') # 2a copy_folder(gen_path, hyp_a) generate_attributes(train_path, hyp_a, hyp_a) # 2b + c copy_folder(hyp_a, hyp_b) generate_qslinks(train_path, hyp_b, hyp_b) generate_olinks(train_path, hyp_b, hyp_b) generate_movelinks(train_path, hyp_b, hyp_b) copy_folder(hyp_b, hyp_c)
@author: Aaron Levine @email: [email protected] generate documents for configuration 3 tasks """ import re, os from util.model.baseline_classifier import copy_folder from util.d_fill_link_attrs import generate_qslinks, generate_olinks,\ generate_movelinks if __name__ == "__main__": with open('config.txt') as fo: text = fo.read() train_path = re.findall('TRAINING_PATH *= *(.*)', text)[0] gen_path = re.findall('CONFIG_3_GEN_PATH *= *(.*)', text)[0] parent_path = os.path.dirname(gen_path) hyp_a = os.path.join(parent_path, '3a') hyp_b = os.path.join(parent_path, '3b') # 2b + c copy_folder(gen_path, hyp_a) generate_qslinks(train_path, hyp_a, hyp_a) generate_olinks(train_path, hyp_a, hyp_a) generate_movelinks(train_path, hyp_a, hyp_a) copy_folder(hyp_a, hyp_b)