Seq2seq-Chatbot-for-Keras
Seq2seq-Chatbot-for-Keras copied to clipboard
NameError: name 'embedding_matrix' is not defined
In conversation.py
Shared_Embedding = Embedding(output_dim=word_embedding_size, input_dim=dictionary_size, weights=[embedding_matrix], input_length=maxlen_input, name='Shared')
however it produces the error above, should we reimport embeddings?
Hi Vladimir,
If this line has been processed, it's because you don't have the weights_file, see the code:
if os.path.isfile(weights_file): Shared_Embedding = Embedding(output_dim=word_embedding_size, input_dim=dictionary_size, input_length=maxlen_input, name='Shared') else: Shared_Embedding = Embedding(output_dim=word_embedding_size, input_dim=dictionary_size, weights=[embedding_matrix], input_length=maxlen_input, name='Shared') word_embedding_context = Shared_Embedding(input_context)
I suggest you download the net weights, "my_model_weights20.h5", which can be found here
yes, thanks, I collected my own corpus and retrained it, the training failed, that's why I didn't have this file and the respective error
Okay, so you have to download the Glove folder 'glove.6B' from here and include this folder in the directory of the chatbot.