pub trait CrossEncoder: Send + Sync {
// Required method
fn score<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
docs: &'life2 [Document],
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Scores (query, doc) pairs.
Required Methods§
Sourcefn score<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
docs: &'life2 [Document],
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn score<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
docs: &'life2 [Document],
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Score every doc against query. Higher = more relevant.
Implementations should batch when possible.