def preprocess(ops, nlp, rows, get_ids):
Xs = []<EOL>ys = []<EOL>for (text1, text2), label in rows:<EOL><INDENT>Xs.append((get_ids([nlp(text1)])[<NUM_LIT:0>], get_ids([nlp(text2)])[<NUM_LIT:0>]))<EOL>ys.append(label)<EOL><DEDENT>return Xs, to_categorical(ys, nb_classes=<NUM_LIT:2>)<EOL>
Parse the texts with spaCy. Make one-hot vectors for the labels.