Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def get_integer_seq(seq):
return [token2int[w] for w in seq.split()]
# convert text sequences to integer sequences
x_int = [get_integer_seq(i) for i in x]
y_int = [get_integer_seq(i) for i in y]
# convert lists to numpy arrays
x_int = np.array(x_int)
y_int = np.array(y_int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment