-
Notifications
You must be signed in to change notification settings - Fork 195
padding_sentence的bug #12
Copy link
Copy link
Open
Description
data_helper.py里面
padding_sentences函数并不能对过长的句子进行截断
bug出现在 sentence = sentence[:max_sentence_length]
这个只能修改sentence变量并不能把sentence的修改应用到sentences列表里
测试代码:
a=[
[1,2,3,4],
[1,2,3,4,5,6],
[1,2,3,4,5,6,7,8,9],
]
for s in a:
if len(s) > 5:
a=a[:5]
print(a)
[[1, 2, 3, 4], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6, 7, 8, 9]]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels