diff --git a/examples/hello_hybrid_sparse_dense.py b/examples/hello_hybrid_sparse_dense.py index 3c30d03d1..98541c521 100644 --- a/examples/hello_hybrid_sparse_dense.py +++ b/examples/hello_hybrid_sparse_dense.py @@ -1,9 +1,18 @@ # A demo showing hybrid semantic search with dense and sparse vectors using Milvus. # You can optionally choose to use the BGE-M3 model to embed the text as dense -# and sparse vectors, or simply use random generated vectors as the example. - -# To use BGE-M3 model, you need to install the optional `model` module in pymilvus: +# and sparse vectors, or simply use random generated vectors as an example. +# Note that the sparse vector search feature is only available in Milvus 2.4.0 or +# higher version. Make sure you follow https://milvus.io/docs/install_standalone-docker.md +# to set up the latest version of Milvus in your local environment. + +# To connect to Milvus server, you need the python client library called pymilvus. +# To use BGE-M3 model, you need to install the optional `model` module in pymilvus. +# You can get them by simply running the following commands: +# pip install pymilvus # pip install pymilvus[model] + +# If true, use BGE-M3 model to generate dense and sparse vectors. +# If false, use random numbers to compose dense and sparse vectors. use_bge_m3 = True # The overall steps are as follows: @@ -112,4 +121,4 @@ def random_embedding(texts): # text: Artificial intelligence was founded as an academic discipline in 1956. distance 0.016129031777381897 # Drop the collection to clean up the data. -utility.drop_collection(col_name) \ No newline at end of file +utility.drop_collection(col_name)