Does langchain Documents work in BM25S? #17
-
from langchain.docstore.document import Document doc = Document(page_content="text", metadata={"source": "local"}) Instead of a list of string, I want to give a list of Langchain documents but it's not working |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I believe it is common to see langchain add internal support to a specific library (e.g. openai, rank-bm25, huggingface, see this for example). Perhaps it would make sense to open a PR on the langchain repo: https://github.com/langchain-ai/langchain Otherwise, it'd make sense to convert the langchain document object to text, I think it should be documented in the langchain docs. |
Beta Was this translation helpful? Give feedback.
-
As I am Working on RAG and I want some metadata of that corresponding retrieved text, is there any way I can access it using bm25s retriever? |
Beta Was this translation helpful? Give feedback.
bm25s
does not provide support for langchain objects, as it is not a necessary dependency.I believe it is common to see langchain add internal support to a specific library (e.g. openai, rank-bm25, huggingface, see this for example). Perhaps it would make sense to open a PR on the langchain repo: https://github.com/langchain-ai/langchain
Otherwise, it'd make sense to convert the langchain document object to text, I think it should be documented in the langchain docs.