Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- max_words = 1000
- tokenize = keras.preprocessing.text.Tokenizer(num_words=max_words, char_level=False)
- tokenize.fit_on_texts(train_text) # fit tokenizer to our training text data
- x_train = tokenize.texts_to_matrix(train_text)
- x_test = tokenize.texts_to_matrix(test_text)
- array([[0., 1., 1., ..., 0., 0., 0.],
- [0., 1., 1., ..., 0., 0., 0.],
- [0., 1., 1., ..., 0., 0., 0.],
- ...,
- [0., 1., 1., ..., 0., 0., 0.],
- [0., 1., 1., ..., 0., 0., 0.],
- [0., 1., 1., ..., 0., 0., 0.]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement