Last active
April 1, 2020 16:28
-
-
Save jamescalam/5d91af05242cfe2f9beebee861dcf1d1 to your computer and use it in GitHub Desktop.
Short code for building mapping of character to index (char2idx) and index to character (idx2char).
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
char2idx = {c:i for i, c in enumerate(vocab)} | |
idx2char = np.array(vocab) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment