Created
February 23, 2018 09:38
-
-
Save Tony607/704234bede5841870384eaad9de0f5aa to your computer and use it in GitHub Desktop.
source: How to generate realistic yelp restaurant reviews with Keras | DLology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of unique characters in the corpus | |
chars = sorted(list(set(text))) | |
print('Unique characters:', len(chars)) | |
# Dictionary mapping unique characters to their index in `chars` | |
char_indices = dict((char, chars.index(char)) for char in chars) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment