Created
February 6, 2019 09:45
-
-
Save prateekjoshi565/bf7bc3b1513467f2a7fcd6779331a778 to your computer and use it in GitHub Desktop.
Encode Sequences
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
# encode and pad sequences | |
def encode_sequences(tokenizer, length, lines): | |
# integer encode sequences | |
seq = tokenizer.texts_to_sequences(lines) | |
# pad sequences with 0 values | |
seq = pad_sequences(seq, maxlen=length, padding='post') | |
return seq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment