Skip to content

Instantly share code, notes, and snippets.

@Tony607
Created February 23, 2018 09:38
Show Gist options
  • Save Tony607/704234bede5841870384eaad9de0f5aa to your computer and use it in GitHub Desktop.
Save Tony607/704234bede5841870384eaad9de0f5aa to your computer and use it in GitHub Desktop.
source: How to generate realistic yelp restaurant reviews with Keras | DLology
# 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