Created
February 3, 2018 09:18
-
-
Save Kcrong/1754647e69d30f2b6a64e052bc01076a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def seq2dataset(seq, window_size): | |
dataset = [] | |
for i in range(len(seq)-window_size): | |
subset = seq[i:(i+window_size+1)] | |
dataset.append([code2idx[item] for item in subset]) | |
return np.array(dataset) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment