← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 6479.x.15.a · 生成模型:DeepSeek-V4.1-Flash

向量检索用语义相近替代字面匹配

理解等级:中级

向量检索把文本变成一串数字(向量)存进数据库,查询时找”距离最近”的向量。做这个转换的模型叫嵌入模型(embedding model),它和基础模型共享同一套思路:把文本变成 token,再映射为可计算的表示。

关键差别在匹配依据。关键词检索要求字面命中,查询”汽车”就找不到写着”轿车”的条目;向量检索比较的是表示上的接近程度,因此查 car 也可能返回含 automobile 或 vehicle 的条目。这种”意思接近就能命中”的能力,正是 RAG 愿意搭配向量库的原因——用户可以按自己的说法提问,而不必猜文档里的措辞。

代价是匹配结果不再可解释为”包含某词”,质量取决于嵌入模型与数据组织方式;同义命中与误召回会同时增加,需要用重排、过滤或混合检索来收口。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • AI Applications and Their Lifecycle · 查看原书依据

      Storing these vectors in a database allows querying for similar vectors. Different from a keyword-based search, this is not based on exact string matches. Instead, due to the characteristics of the tokens, this allows finding entries that are semantically similar. For example, querying for car might also return entries that contain automobile or vehicle.

    参考来源

    - 位置:《Building AI Agent Platforms》第01章《AI Applications and Their Lifecycle》(源文件:extracted/Building AI Agent Platforms/_epub-src/OEBPS/ch01.html,来源项目 book-source) - 结论依据:原文解释嵌入模型把文本转为向量、向量库按相似度查询,并以 car/automobile/vehicle 说明其与关键词检索的差别。 - 原始内容:Storing these vectors in a database allows querying for similar vectors. Different from a keyword-based search, this is not based on exact string matches. Instead, due to the characteristics of the tokens, this allows finding entries that are semantically similar. For example, querying for car might also return entries that contain automobile or vehicle.