def loadTest(self, data_file, max_seq_len, load_data): '''Load indexed data''' if os.path.exists(data_file + '.pkl') and load_data: data = pkl.load(open(data_file + '.pkl', 'rb')) logging.info("Loaded data from %s", data_file + '.pkl') else: data = load_test(data_file, max_seq_len, s1_idx=1, s2_idx=None, targ_idx=2, idx_idx=0, skip_rows=1) pkl.dump(data, open(data_file + '.pkl', 'wb')) logging.info("Saved data to %s", data_file + '.pkl') return {'X': data[0], 'y': data[1], 'idx': data[2]}
def loadTest(self, data_file, max_seq_len, load_data): '''Load indexed data''' if os.path.exists(data_file + '.pkl') and load_data: data = pkl.load(open(data_file + '.pkl', 'rb')) logging.info("Loaded data from %s", data_file + '.pkl') else: targ_map = {'not_entailment': 0, 'entailment': 1} data = load_test(data_file, max_seq_len, s1_idx=1, s2_idx=2, targ_idx=None, idx_idx=0, targ_map=targ_map) pkl.dump(data, open(data_file + '.pkl', 'wb')) logging.info("Saved data to %s", data_file + '.pkl') return data