Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Last active July 28, 2020 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/a31747636959ae0ef2c328e4ec749e09 to your computer and use it in GitHub Desktop.
Save prateekjoshi565/a31747636959ae0ef2c328e4ec749e09 to your computer and use it in GitHub Desktop.
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