Hyde Retrieval
HyDERetrieval Class Documentation
Last updated
HyDERetrieval Class Documentation
Last updated
The HyDERetrieval
class is inspired by the paper "". It uses a language model to generate a hypothetical passage for a given query and then retrieves passages using this hypothetical passage as the query.
First, prepare the retrieval instance you want to use and set up your system prompt. In this example, we are using BM25Retrieval
as the base retrieval method and setting up a custom system prompt.
Ingest a list of s into the retrieval in the HyDE retrieval.
Retrieve top-k passages for a given query. You can also specify model kwargs such as max tokens for hypothetical passage generation model. modle kwargs reference is in .
You can also filter the retrieved passages. Use the retrieve_with_filter
method and provide the query, top-k value, and a list of content, filepath, or metadata values to filter by.
Here's an example:
In this method uses DB.search
method. Please refer for further information.