How to get document's sparse vector ? #107
Answered
by
xhluca
Zrealshadow
asked this question in
Q&A
-
Hi, Now I want to use this library to generate doc's sparse vector and save it in vectorDB for further retrieval. Does this library provide api to generate the sparse embedding ? Many appreciates |
Beta Was this translation helpful? Give feedback.
Answered by
xhluca
Jan 21, 2025
Replies: 1 comment
-
Yes, you can save the indexes as numpy arrays. The numpy arrays can be reloaded directly and accessed via bm25s, or even without bm25s (directly in numpy if you want). See this end to end example: https://github.com/xhluca/bm25s/blob/main/examples/save_and_reload_end_to_end.py |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xhluca
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you can save the indexes as numpy arrays.
The numpy arrays can be reloaded directly and accessed via bm25s, or even without bm25s (directly in numpy if you want).
See this end to end example: https://github.com/xhluca/bm25s/blob/main/examples/save_and_reload_end_to_end.py