title: Unable to import Tokenizer from Keras
body: <p>Currently working through a Deep Learning example and they are using a Tokenizer package. I am getting the following error:</p>
  
  <p>AttributeError: 'Tokenizer' object has no attribute 'word_index'</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from keras.preprocessing.text import Tokenizer
  
  samples = ['The cat say on the mat.', 'The dog ate my homework.']
  
  tokenizer = Tokenizer(num_words=1000)
  tokenizer.fit_on_sequences(samples)
  
  sequences = tokenizer.texts_to_sequences(samples)
  
  one_hot_results = tokenizer.texts_to_matrix(samples, mode='binary')
  
  word_index = tokenizer.word_index
  print('Found %s unique tokens.' % len(word_index))
  </code></pre>
  
  <p>Could anyone help me catch my mistake? </p>