Find answers from the community

Updated 4 months ago

Is there a way to create a keyword based

At a glance

The community member is asking if there is a way to create a keyword-based retriever like BM25Retriever based on an existing index, as they have already embedded and ingested their documents into a Postgres vectorstore.

In the comments, another community member suggests that the custom retrieval example in the documentation shows an example of using a keyword-based retriever. However, the original poster then asks how to create a keyword-based retriever based on the existing index.

Another community member responds with a potential solution, suggesting that the user can use the nodes from the existing index to create a keyword index using the SimpleKeywordTableIndex class.

There is no explicitly marked answer in the provided information.

Useful resources
Is there a way to create a keyword based retriever like BM25Retriever based on an existing index? I have already embedded and ingested my documents into a postgres vectorstore and want to create a retriever from an already existing index.
W
m
3 comments
I think the custom retrieval example shows example of using keyword based retriever only.

How lucky!
https://docs.llamaindex.ai/en/stable/examples/query_engine/CustomRetrievers.html
But then how do I create a keyword based retriever based on the index already created?
I think you can use the nodes to create the keyword index and then follow the above link

Plain Text
nodes = index.docstore.docs
keyword_index = SimpleKeywordTableIndex(nodes, storage_context=storage_context)
Add a reply
Sign up and join the conversation on Discord