← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6668.i · 生成模型:GPT-6

归一化向量点积就是余弦相似度

理解等级:中级

当查询和文档均已L2归一化,点积恰等于余弦相似度,而不是余弦距离。TfidfVectorizer默认会做L2归一化,因此示例无须为这一目的再除一次范数;改掉norm或用手写权重后则须重新核对。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      #3 Δot products are not the same as cosine distances, but they are proportional. If you’re looking for something related to Haycon, then you probably want to add that word to your query. It will have a large TF–IDF value, so you may need to adjust your query a bit. And to improve your relevance score, you can normalize all the TF–IDF vectors by their

    参考来源

    - 位置:《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) - 结论依据:摘录中关于归一化向量点积就是余弦相似度的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:#3 Δot products are not the same as cosine distances, but they are proportional. If you’re looking for something related to Haycon, then you probably want to add that word to your query. It will have a large TF–IDF value, so you may need to adjust your query a bit. And to improve your relevance score, you can normalize all the TF–IDF vectors by their