Instantly share code, notes, and snippets.

Embed
What would you like to do?
max_words = 10000
# Generate split training and testing data (80% training, 20% testing)
x_train, x_test, y_train, y_test = load_encoded_data(data_split=0.8)
# Vectorizing the input data into a Keras readable format (sequence matrix)
tokenizer = Tokenizer(num_words=max_words)
x_train = tokenizer.sequences_to_matrix(x_train, mode='binary')
x_test = tokenizer.sequences_to_matrix(x_test, mode='binary')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment