Last active
November 5, 2018 00:10
-
-
Save WillKoehrsen/de03f3c43bea34111ce1948c0c0bd9ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
features = [] | |
labels = [] | |
training_length = 50 | |
# Iterate through the sequences of tokens | |
for seq in sequences: | |
# Create multiple training examples from each sequence | |
for i in range(training_length, len(seq)): | |
# Extract the features and label | |
extract = seq[i - training_length:i + 1] | |
# Set the features and label | |
features.append(extract[:-1]) | |
labels.append(extract[-1]) | |
features = np.array(features) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment