Created
July 28, 2020 07:01
-
-
Save prateekjoshi565/10aad66efe6e04d8b6d940a4c1a6572c to your computer and use it in GitHub Desktop.
This file contains 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
# create integer-to-token mapping | |
int2token = {} | |
cnt = 0 | |
for w in set(" ".join(movie_plots).split()): | |
int2token[cnt] = w | |
cnt+= 1 | |
# create token-to-integer mapping | |
token2int = {t: i for i, t in int2token.items()} | |
token2int["the"], int2token[14271] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment