Skip to content
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

关于prepare_data函数 #19

Open
powea000 opened this issue Apr 14, 2020 · 1 comment
Open

关于prepare_data函数 #19

powea000 opened this issue Apr 14, 2020 · 1 comment

Comments

@powea000
Copy link

for l_x, s_x, l_y, s_y, l in zip(lengths_x, seqs_x, lengths_y, seqs_y, labels):
if l_x > maxlen_1:
new_seqs_x.append(s_x[-maxlen_1:])
new_lengths_x.append(maxlen_1)
else:
new_seqs_x.append(s_x)
new_lengths_x.append(l_x)
if l_y > maxlen_2:
new_seqs_y.append(s_y[:maxlen_2])
new_lengths_y.append(maxlen_2)
else:
new_seqs_y.append(s_y)
new_lengths_y.append(l_y)

这里为什么s_x是取后maxlen_1的词,而s_y是取前maxlen_2的词

@DennisLiYan
Copy link

我在看代码的时候也觉得这里很奇怪,,不知道是不是 训练集有关

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants