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
` for pair in pairs_trained:
num_stack = []
for word in pair[1]:
temp_num = []
flag_not = True
if word not in output_lang.index2word:
flag_not = False
for i, j in enumerate(pair[2]):
if j == word:
temp_num.append(i)
if not flag_not and len(temp_num) != 0:
num_stack.append(temp_num)
if not flag_not and len(temp_num) == 0:
num_stack.append([_ for _ in range(len(pair[2]))])
num_stack.reverse()
input_cell = indexes_from_sentence(input_lang, pair[0])
output_cell = indexes_from_sentence(output_lang, pair[1], tree)`
The text was updated successfully, but these errors were encountered:
作者您好,我在阅读您的代码时不知道num_stack的作用是什么。为什么式子里面有的数字没有被替换成N*呢?
希望能解答下,感谢:)
` for pair in pairs_trained:
num_stack = []
for word in pair[1]:
temp_num = []
flag_not = True
if word not in output_lang.index2word:
flag_not = False
for i, j in enumerate(pair[2]):
if j == word:
temp_num.append(i)
The text was updated successfully, but these errors were encountered: