HyDEQueryExpansion
Models & Types ยท AiDotNet.RetrievalAugmentedGeneration.QueryExpansion
Hypothetical Document Embeddings (HyDE) query expansion (Gao et al., 2022). Generates hypothetical answer passages for a query so that a dense retriever matches document-shaped text rather than the short question. When a real text generator is supplied, the passages are written by the LLM (true HyDE); otherwise a deterministic template is used as an offline fallback.
Inheritance: QueryExpansionBase โ HyDEQueryExpansion
Constructors
| Constructor | Summary |
|---|---|
HyDEQueryExpansion(ITextGenerator generator, int numHypotheticals) |
Initializes a new instance of the HyDEQueryExpansion class. |
Methods
| Method | Summary |
|---|---|
List<string> ExpandQuery(string query) |
Expands a query by generating hypothetical documents. |