def make_joint_corpus(datasets, joint): parts = ['dev', 'test', 'train', 'train-all'] for part in parts: old_file = 'data/{}/raw/{}.txt'.format(joint, part) if os.path.exists(old_file): os.remove(old_file) elif not os.path.exists(os.path.dirname(old_file)): os.makedirs(os.path.dirname(old_file)) for name in datasets: append_tags(name, joint, part) #?
def make_joint_corpus(datasets, joint): parts = ['dev', 'test', 'train', 'train-all'] for part in parts: old_file = 'data/{}/raw/{}.txt'.format(joint, part) if os.path.exists(old_file): os.remove(old_file) elif not os.path.exists(os.path.dirname(old_file)): os.makedirs(os.path.dirname(old_file)) for name in datasets: append_tags(name, joint, part)
def make_joint_corpus(datasets, joint): parts = ["dev", "test", "train", "train-all"] for part in parts: old_file = "{}/{}/raw/{}.txt".format(data_path, joint, part) if os.path.exists(old_file): os.remove(old_file) elif not os.path.exists(os.path.dirname(old_file)): os.makedirs(os.path.dirname(old_file)) for name in datasets: append_tags( os.path.join(data_path, name, "raw"), os.path.dirname(old_file), name, part, encode="utf-8", )