}
def gen_batches(self, batch_size, data_type="train", shuffle=True):
y = np.zeros(batch_size)
data = self.data[data_type]
num_steps = len(data) // batch_size
if data_type == "train":
if shuffle:
After Change
context = [el["context"] for el in context_response_data]
response = [el["response"] for el in context_response_data]
negative_response = self.create_neg_resp_rand(context_response_data, batch_size, data_type)
x = [[context[i], [response[i]]+[negative_response[i]]] for i in range(len(context_response_data))]
yield (x, y)
if data_type in ["valid", "test"]:
for i in range(num_steps + 1):