Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active December 31, 2018 05:08
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 lettergram/7f73576be5ce5d0d5da592292f462ced to your computer and use it in GitHub Desktop.
Save lettergram/7f73576be5ce5d0d5da592292f462ced to your computer and use it in GitHub Desktop.
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