Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: BM25 Retriever takes long time to load with docstore are its parameter #13389

Open
1 task done
Prem-Nitin opened this issue May 9, 2024 · 2 comments
Open
1 task done
Labels
question Further information is requested

Comments

@Prem-Nitin
Copy link

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

I am using bm25retriever.

BM25Retriever.from_defaults(docstore=get_document_store() , similarity_top_k = 10)

this takes a long time to get initialized. Any way to make it fast.

Another question is, will changing it to MongodbAtlasBM25retriever make it faster

@Prem-Nitin Prem-Nitin added the question Further information is requested label May 9, 2024
Copy link

dosubot bot commented May 9, 2024

To address the slow initialization time of BM25Retriever with a document store, consider these optimizations:

  1. Adjust similarity_top_k: Lowering this value can reduce computation during retrieval, potentially affecting initialization time.
  2. Optimize Tokenizer: Using a simpler or more efficient tokenizer could speed up corpus processing.
  3. Corpus Preparation: Optimizing how the corpus is prepared, through more efficient text processing or parallelization, could reduce initialization time.
  4. Data Loading Strategy: Efficient data loading or preprocessing can lead to performance improvements.

Switching to MongoDBAtlasBM25Retriever might offer faster initialization if it leverages MongoDB Atlas's infrastructure more efficiently than your current setup. This could include optimizations specific to MongoDB Atlas, such as efficient query execution plans. However, the actual improvement depends on various factors like your MongoDB Atlas configuration, dataset size and complexity, and network connection efficiency.

For detailed implementation and further optimizations, reviewing the base code for both BM25Retriever and MongoDBAtlasBM25Retriever could provide more insights into potential optimizations.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@logan-markewich
Copy link
Collaborator

There's no way to make it faster that I know of. It's loading all the nodes from the docstore that can be slow.

You can get those nodes another way if you want, and pass them in instead of a docstore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants