Closed rangehow closed 7 months ago
the same error
same
same
changing my import statements resolved the issue.
from langchain.retrievers.ensemble import EnsembleRetriever
from langchain_community.retrievers.bm25 import BM25Retriever
it seems the example https://python.langchain.com/docs/modules/data_connection/retrievers/ensemble needs to be updated with this change
Updating the package did the trick for me
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
When I want to use 'https://python.langchain.com/docs/integrations/retrievers/bm25', as the snippet
from langchain.retrievers import BM25Retriever
, an error throwed that hint user to use pip install -U langchain_community. I did it as mentioned. But I found that JSONLoader cannot be load and the error message is very short. I have to dive into the code and found that after langchian_community updated, jsonloader support c language which is a dict contained in langchian without 'c'so the title issue appear. After update langchain, this issue solved.
Description
I have two suggestion that: 1.Consider updating the outdated BM25 document. 2 The issue caused by inconsistent versions should not be addressed so briefly. Consider providing a more specific prompt or including the appropriate version of LangChain in the requirements of LangChain_Community.
System Info
The issue will appear in langchian 0.1.7 and community 0.0.21 / while 0.1.8+0.0.21 is ok