Update pretrained_word_embeddings.py
diff --git a/examples/pretrained_word_embeddings.py b/examples/pretrained_word_embeddings.py
index 4fea37a69bb..069024c3fdb 100644
--- a/examples/pretrained_word_embeddings.py
+++ b/examples/pretrained_word_embeddings.py
@@ -101,10 +101,10 @@
 print('Preparing embedding matrix.')
 
 # prepare embedding matrix
-num_words = min(MAX_NUM_WORDS, len(word_index)) + 1
+num_words = min(MAX_NUM_WORDS, len(word_index) + 1)
 embedding_matrix = np.zeros((num_words, EMBEDDING_DIM))
 for word, i in word_index.items():
-    if i > MAX_NUM_WORDS:
+    if i >= MAX_NUM_WORDS:
         continue
     embedding_vector = embeddings_index.get(word)
     if embedding_vector is not None:

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md
-->

### Summary

Hello,

Here's a small example why I think there's a small mistake in the code.

![Example Code](https://i.imgur.com/jZVO97d.png)

Now if you check we've specified 

> MAX_NUM_WORDS = 3

 but tokenizer return **n-1** words i.e **2**. So we only have two words in our integer coded corpus.
```
num_words = min(MAX_NUM_WORDS, len(tokenizer.word_index) + 1)      # i.e min(3, 8 + 1)
embedding_matrix = np.zeros((num_words, 10))
print(embedding_matrix.shape)
(3, 10)
```

Then this should be how we create embedding matrix.
```
for word, i in word_index.items():
    if i >= MAX_NUM_WORDS:     # i. e i >= 3 We also don't want word three to be included.
        continue
    embedding_vector = embeddings_index.get(word)
    if embedding_vector is not None:
         embedding_matrix[i] = embedding_vector
```

### Related Issues
None.
### PR Overview

- [n] This PR requires new unit tests [y/n] (make sure tests are included)
- [n] This PR requires to update the documentation [y/n] (make sure the docs are up-to-date)
- [n] This PR is backwards compatible [y/n]
- [n] This PR changes the current API [y/n] (all API changes need to be approved by fchollet)
