q, pa = eli.split("\t")
pa_list = [int(el) - 1 for el in pa.split(" ")]
for elj in pa_list:
contexts.append([int(el.split("_")[1]) for el in q.split(" ")])
responses.append(elj)
positive_responses_pool.append(pa_list)
train_data = [{"context": el[0], "response": el[1],
"pos_pool": el[2], "neg_pool": None}
After Change
q, pa = eli.split("\t")
pa_list = [int(el) - 1 for el in pa.split(" ")]
for elj in pa_list:
contexts.append(self.idxs2cont_vocab[q])
responses.append(elj)
positive_responses_pool.append(pa_list)
train_data = [{"context": el[0], "response": el[1],
"pos_pool": el[2], "neg_pool": None}