You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In line 16 you use input = input + [0] * (max_len - len(input))
the padding, you use 0, which means the first word 'Lorem'.
but it is not the right choose.
I think you can change like that
# word_dict = {w: i for i, w in enumerate(list(set(sentence.split())))}
# number_dict = {i: w for i, w in enumerate(list(set(sentence.split())))}
word_dict = {w: i for i, w in enumerate(['PAD']+list(set(sentence.split())))}
number_dict = {i: w for i, w in enumerate(['PAD']+list(set(sentence.split())))}
The text was updated successfully, but these errors were encountered:
In line 16 you use
input = input + [0] * (max_len - len(input))
the padding, you use 0, which means the first word 'Lorem'.
but it is not the right choose.
I think you can change like that
The text was updated successfully, but these errors were encountered: