pub struct HydePreprocessor<G: HypotheticalGenerator> { /* private fields */ }Expand description
HyDE (Hypothetical Document Embeddings) preprocessor.
Instead of searching with the query directly, HyDE generates a hypothetical document that would answer the query, then uses that for retrieval. This can improve semantic matching by generating content in the same “language” as the documents being searched.
Implementations§
Source§impl<G: HypotheticalGenerator> HydePreprocessor<G>
impl<G: HypotheticalGenerator> HydePreprocessor<G>
Sourcepub fn with_original_query(self, include: bool) -> Self
pub fn with_original_query(self, include: bool) -> Self
Include the original query alongside the hypothetical document.
Trait Implementations§
Source§impl<G: Clone + HypotheticalGenerator> Clone for HydePreprocessor<G>
impl<G: Clone + HypotheticalGenerator> Clone for HydePreprocessor<G>
Source§fn clone(&self) -> HydePreprocessor<G>
fn clone(&self) -> HydePreprocessor<G>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<G: Debug + HypotheticalGenerator> Debug for HydePreprocessor<G>
impl<G: Debug + HypotheticalGenerator> Debug for HydePreprocessor<G>
Source§impl<G: HypotheticalGenerator> QueryPreprocessor for HydePreprocessor<G>
impl<G: HypotheticalGenerator> QueryPreprocessor for HydePreprocessor<G>
Auto Trait Implementations§
impl<G> Freeze for HydePreprocessor<G>where
G: Freeze,
impl<G> RefUnwindSafe for HydePreprocessor<G>where
G: RefUnwindSafe,
impl<G> Send for HydePreprocessor<G>
impl<G> Sync for HydePreprocessor<G>
impl<G> Unpin for HydePreprocessor<G>where
G: Unpin,
impl<G> UnsafeUnpin for HydePreprocessor<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for HydePreprocessor<G>where
G: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more