Skip to content

Instantly share code, notes, and snippets.

@mohdsanadzakirizvi
Last active August 7, 2019 02:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
def create_seq(text):
length = 30
sequences = list()
for i in range(length, len(text)):
# select sequence of tokens
seq = text[i-length:i+1]
# store
sequences.append(seq)
print('Total Sequences: %d' % len(sequences))
return sequences
# create sequences
sequences = create_seq(data_new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment