Error in embedding document using BM25EmbeddingFunction #40954
-
Hello team, I have implemented Hybrid search which was working fine till recently. But now it's throwing error. Code throwing error:
Error message:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
I use your script to test, didn't get the error, my pymilvus_model version is 0.3.0 |
Beta Was this translation helpful? Give feedback.
-
Mine is 0.3.1 version. Downgraded it to 0.3.0 and I'm still getting the same error. May i know other relevant libraries versions which works for you? |
Beta Was this translation helpful? Give feedback.
-
I'm not using pandas in this script. This is the error stack:
|
Beta Was this translation helpful? Give feedback.
-
Hi @shalini0311 unrelated this issue, the recommendation is to use Milvus' native support for full text search instead of using This has a lot of benefit such as you don't need to worry about vocabulary change as you add more documents to the corpus, and it's more efficient that externally computing the BM25 score. |
Beta Was this translation helpful? Give feedback.
@shalini0311
Downgrade your scipy version to 1.14.1.
I believe there is a behavior change for scipy.sparse.vsstack in scipy 1.15.0. The output of scipy.sparse.vsstack.tocsr() is changed.
The milvus_model.sparse.BM25EmbeddingFunction calls scipy.sparse.vsstack.tocsr() to generate a sparse array.
Use this script to test.
With scipy 1.14.1, it works fine.
With scipy 1.15.0, it throws "not enough values to unpack" error.