Skip to content

Instantly share code, notes, and snippets.

@rajeshmr
Created December 7, 2017 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeshmr/baf19456ff304f5ab85200c4d8bc9135 to your computer and use it in GitHub Desktop.
Save rajeshmr/baf19456ff304f5ab85200c4d8bc9135 to your computer and use it in GitHub Desktop.
word_index = tokenizer.word_index
test_string = "sports action spy pen camera"
print("word\t\tid")
print("-" * 20)
for word in test_string.split():
print("%s\t\t%s" % (word, word_index[word]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment