搜索
Faiss 召回 python Annoy 召回 python Annoy 召回原理 Elastic 向量召回
Annoy 检索工具
:https://zhuanlan.zhihu.com/p/402823379
Faiss 工具的使用, K表示返回的结果数字。安装不成功之后,./pip install faiss-cpu
import numpy as np
import faiss
d = 64
nb = 100
nq = 10
# 构建向量库
xb = np.random.random((nb, d)).astype('float32')
xb[:, 0] += np.arange(nb) / 1000.
xq = np.random.random((nq, d)).astype('float32')
xq[:, 0] += np.arange(nq) / 1000.
# 关键步骤,build index
index = faiss.IndexFlatL2(d)
index.add(xb)
k = 4
D, I = index.search(xq[:5], k) # 分别返回距离和索引
http://events.jianshu.io/p/ba81a30cdc2a
参考资料
https://www.6aiq.com/article/1547042568485
https://www.bilibili.com/video/BV1QS4y1j7yK/?spm_id_from=333.337.search-card.all.click (淘宝搜索排序算法)
https://zhuanlan.zhihu.com/p/393036573 (搜索排序系统讲解)
https://zhuanlan.zhihu.com/p/511459586 (搜索召回)
https://zhuanlan.zhihu.com/p/523602103 (搜索算法面试)