知识卡片
向量化要按实际运算路径解释
把文本编码成向量与使用数组底层批量数值运算,是向量化的两种相关用法。Python循环或内置sum不自动变成底层批量运算;性能还受布局、类型、库实现和内存影响,不能只凭写了乘号或语言动态类型推断加速。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Perhaps, you have read about vectorizing code on the internet; however, this refers to something entirely different than vectorizing text. Vectorizing text refers to converting text into a meaningful numerical vector representation of text, while vectorizing code, demonstrated in listing 3.5, refers to speeding up your code by taking advantage of powerful compiled libraries, like numpy, and avoiding for loops in your code. It’s called
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第03章《词频与逆文档频率向量》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-3.html)
- 结论依据:摘录中关于向量化要按实际运算路径解释的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Perhaps, you have read about vectorizing code on the internet; however, this refers to something entirely different than vectorizing text. Vectorizing text refers to converting text into a meaningful numerical vector representation of text, while vectorizing code, demonstrated in listing 3.5, refers to speeding up your code by taking advantage of powerful compiled libraries, like numpy, and avoiding for loops in your code. It’s called