-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError #6
Comments
sampled_token_index = np.argmax(output_tokens[0, -1, :]) + 2 solved here: #3 |
Thank @shifatul-i for your help Thank you so much |
I was successfully able to run the entire code set on the problem I am working on. when I run apply the code to my problem, I get the following output for the code as follows. Code: Output example: How do I fix the output to get a better result. Any help would be highly appreciated. Thanks. |
Facing similar issue |
It looks like your models are overfitting. @VJSo007 @shrenik007 If yes, you can improve text generation by applying a randomness, or even better beam-search. Randomness can be applying be using Thats my decode_sentence function:
|
I have got this key error. Please help me. Thank you
KeyError Traceback (most recent call last)
in ()
2 print("Review:",seq2text(x_tr[i]))
3 print("Original summary:",seq2summary(y_tr[i]))
----> 4 print("Predicted summary:",decode_sequence(x_tr[i].reshape(1,max_text_len)))
5 print("\n")
in decode_sequence(input_seq)
17 # Sample a token
18 sampled_token_index = np.argmax(output_tokens[0, -1, :])
---> 19 sampled_token = reverse_target_word_index[sampled_token_index]
20
21 if(sampled_token!='eostok'):
KeyError: 0
The text was updated successfully, but these errors were encountered: