Created
February 19, 2021 07:11
-
-
Save AyishaR/fbe0c8883a7460dba410f253ecf830f1 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
# Tokenization | |
vocab = 1500 | |
mlen = 200 | |
tokenizer = Tokenizer(num_words = vocab, oov_token = '<UNK>') | |
tokenizer.fit_on_texts(Xtrain) | |
Xtrain = tokenizer.texts_to_sequences(Xtrain) | |
Xtrain = pad_sequences(Xtrain, maxlen=mlen) | |
Xval = tokenizer.texts_to_sequences(Xval) | |
Xval = pad_sequences(Xval, maxlen=mlen) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment