pub trait RerankerModel: ModelInfo {
// 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: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A model that re-scores documents against a query for relevance ranking.
Required Methods§
Sourcefn 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,
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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".