text_plain_output_1.png
from keras.datasets import imdb

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)

print('Training data: ')
print(X.shape)
print(y.shape)
print('Classes: ')
print(np.unique(y))
print('Number of words: ')
print(len(np.unique(np.hstack(X))))