text_plain_output_1.png
from keras.datasets import imdb

from keras.preprocessing import sequence

import numpy as np

(X_train, y_train), (X_test, y_test) = imdb.load_data()
X = np.concatenate((X_train, X_test), axis=0)
y = np.concatenate((y_train, y_test), axis=0)

top_words = 10000
vector_size = 32
max_review_lenght = 800
(X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=top_words)
X_train = sequence.pad_sequences(X_train, maxlen=max_review_lenght)
X_test = sequence.pad_sequences(X_test, maxlen=max_review_lenght)

X_train[20]