RerankerModel

Trait RerankerModel 

Source
pub trait RerankerModel: Send + Sync {
    // Required method
    fn rerank<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        docs: &'life2 [&'life3 str],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredDoc>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided method
    fn warmup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A model that re-scores documents against a query for relevance ranking.

Required Methods§

Source

fn rerank<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, query: &'life1 str, docs: &'life2 [&'life3 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredDoc>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Rerank docs by relevance to query, returning scored results (typically sorted by descending score).

Provided Methods§

Source

fn warmup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optional warmup hook. The default is a no-op.

Implementors§