知识卡片
截断长度应检查信息损失分布
pad先取前seq_len项再补到固定长,会丢失所有后续词。若关键否定或灾害条件常在尾部,模型无法利用;应统计被截断比例和错例,并考虑保留策略或分块,而不只按速度挑长度。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
def pad(sequence, pad_value, seq_len): padded = list(sequence)[:seq_len] padded = padded + [pad_value] * (seq_len - len(padded)) return padded There’s one last preprocessing step to complete if you want your CNNs to work well: including the token embeddings you learned about in chapter 6. 7.4.2 Better representation with word embeddings Imagine you are running a short bit of text through your pipeline. Figure 7.15 shows what
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第07章《卷积网络识别文本模式》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-7.html)
- 结论依据:摘录中关于截断长度应检查信息损失分布的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:def pad(sequence, pad_value, seq_len): padded = list(sequence)[:seq_len] padded = padded + [pad_value] * (seq_len - len(padded)) return padded There’s one last preprocessing step to complete if you want your CNNs to work well: including the token embeddings you learned about in chapter 6. 7.4.2 Better representation with word embeddings Imagine you are running a short bit of text through your pipeline. Figure 7.15 shows what