From 844e6ac9650324f783a1e6fce34ecf534b29c7c4 Mon Sep 17 00:00:00 2001 From: Buqian Zheng Date: Wed, 27 Mar 2024 10:38:42 +0800 Subject: [PATCH] In sparse+dense hybrid search example, use IP as the BGE-M3 dense embeddings revelance example Signed-off-by: Buqian Zheng --- examples/hello_hybrid_sparse_dense.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hello_hybrid_sparse_dense.py b/examples/hello_hybrid_sparse_dense.py index 3c30d03d1..08deb9d43 100644 --- a/examples/hello_hybrid_sparse_dense.py +++ b/examples/hello_hybrid_sparse_dense.py @@ -77,7 +77,7 @@ def random_embedding(texts): # into memory for efficient search. sparse_index = {"index_type": "SPARSE_INVERTED_INDEX", "metric_type": "IP"} col.create_index("sparse_vector", sparse_index) -dense_index = {"index_type": "FLAT", "metric_type": "L2"} +dense_index = {"index_type": "FLAT", "metric_type": "IP"} col.create_index("dense_vector", dense_index) col.load() @@ -93,7 +93,7 @@ def random_embedding(texts): sparse_search_params = {"metric_type": "IP"} sparse_req = AnnSearchRequest(query_embeddings["sparse"], "sparse_vector", sparse_search_params, limit=k) -dense_search_params = {"metric_type": "L2"} +dense_search_params = {"metric_type": "IP"} dense_req = AnnSearchRequest(query_embeddings["dense"], "dense_vector", dense_search_params, limit=k)