oswaldoludwig / Seq2seq-Chatbot-for-Keras

This repository contains a new generative model of chatbot based on seq2seq modeling.
Apache License 2.0
331 stars 98 forks source link

KeyError:Something #31

Open Asrix-AI opened 4 years ago

Asrix-AI commented 4 years ago

can you please explain why this error is occurring? Traceback (most recent call last): File "conversation.py", line 215, in Q = tokenize(query) File "conversation.py", line 117, in tokenize X = np.asarray([word_to_index[w] for w in tokenized_sentences]) File "conversation.py", line 117, in X = np.asarray([word_to_index[w] for w in tokenized_sentences]) KeyError: 'something'

oswaldoludwig commented 4 years ago

It looks like your dictionary doesn't have the key "something". You must use a preprocessing function that exists somewhere in my code that replaces all non-dictionary words with a special token, such as UNK.

Asrix-AI commented 4 years ago

But the words that I used were present in the vocab file. (custom data)

Asrix-AI commented 4 years ago

could you please explain?

oswaldoludwig commented 4 years ago

I don't have time now to help you with this, but if you describe your code modifications here, maybe another user can help you debug it. I will leave this issue open.