pub trait SparseEmbedder: Send + Sync {
// Required method
fn embed_sparse(
&self,
texts: &[String],
mode: EmbedMode,
) -> Result<Vec<Vec<(u32, f32)>>>;
}Expand description
Optional extension trait for sparse lexical embeddings.
Each string becomes a sparse vector: (term_id, weight) pairs.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".