pub struct FastEmbedder { /* private fields */ }Implementations§
Source§impl FastEmbedder
impl FastEmbedder
Sourcepub fn recognized(model: &str) -> bool
pub fn recognized(model: &str) -> bool
Whether model is a recognized fastembed model id (i.e. try_for
would return Some), with no side effects — no model download.
Trait Implementations§
Source§impl Embedder for FastEmbedder
impl Embedder for FastEmbedder
fn embed(&self, texts: &[String], kind: EmbedKind) -> Result<Vec<Vec<f32>>>
Source§fn min_similarity(&self) -> f32
fn min_similarity(&self) -> f32
Score floor under which the top match is treated as “nothing relevant”
and the hook injects nothing. Embedder-specific because cosine
distributions differ sharply: the hashed bag-of-words space is sparse, so
unrelated text scores near 0 and a low floor works; bge is anisotropic, so
even unrelated text cosines ~0.5 and the floor must sit well above that.
The default is calibrated for bag-of-words; embedders override it.
Source§fn score_margin(&self) -> f32
fn score_margin(&self) -> f32
Max score gap below the single best match for a co-relevant peer to still
be injected. Tighter spaces (bge) need a smaller margin. Default is for
bag-of-words.
Auto Trait Implementations§
impl !Freeze for FastEmbedder
impl !RefUnwindSafe for FastEmbedder
impl !UnwindSafe for FastEmbedder
impl Send for FastEmbedder
impl Sync for FastEmbedder
impl Unpin for FastEmbedder
impl UnsafeUnpin for FastEmbedder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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