Skip to main content

Module preprocess

Module preprocess 

Source
Expand description

Query preprocessing strategies for improved retrieval.

This module provides preprocessing techniques to enhance query effectiveness:

  • HyDE (Hypothetical Document Embeddings): Generate hypothetical answers for better matching
  • Multi-query expansion: Expand a single query into multiple related queries

Structs§

AnthropicHypotheticalGenerator
Anthropic-backed HyDE generator using Claude API.
ChainedPreprocessor
Chained preprocessor that applies multiple preprocessors in sequence.
HydePreprocessor
HyDE (Hypothetical Document Embeddings) preprocessor.
KeywordExpander
Keyword-based query expander.
MockHypotheticalGenerator
Mock HyDE generator for testing that creates a simple hypothetical answer.
MultiQueryPreprocessor
Multi-query expansion preprocessor.
PassthroughPreprocessor
No-op preprocessor that returns the query unchanged.
QueryAnalysis
Analysis result for a query.
QueryAnalyzer
Query analyzer that extracts structured information from queries.
SynonymExpander
Synonym-based query expander.

Enums§

QueryIntent
Detected intent of a query.

Traits§

HypotheticalGenerator
Trait for generating hypothetical documents from queries.
QueryExpander
Trait for expanding queries into multiple related queries.
QueryPreprocessor
A query preprocessor that transforms or expands queries before retrieval.