Created
March 13, 2018 17:53
Star
You must be signed in to star a gist
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
from keras.preprocessing import text | |
tokenizer = text.Tokenizer() | |
tokenizer.fit_on_texts(norm_bible) | |
word2id = tokenizer.word_index | |
id2word = {v:k for k, v in word2id.items()} | |
vocab_size = len(word2id) + 1 | |
embed_size = 100 | |
wids = [[word2id[w] for w in text.text_to_word_sequence(doc)] for doc in norm_bible] | |
print('Vocabulary Size:', vocab_size) | |
print('Vocabulary Sample:', list(word2id.items())[:10]) |
norm_bible is not defined
is norm_bibe is list of strings??
is norm_bibe is list of strings??
I think norm_bible is the corpus
norm_bible=open('corona.txt','r')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
norm_bible
is not defined