pub struct FallbackEmbedder { /* private fields */ }Expand description
Hash-based fallback embedder.
Generates deterministic pseudo-embeddings using a combination of:
- Word-level hashing for vocabulary capture
- Character n-gram hashing for fuzzy matching
- Normalization to unit length for cosine similarity
This is NOT semantic similarity - it’s based on lexical overlap.
Use FastEmbed for true semantic understanding.
§Examples
use rlm_rs::embedding::{Embedder, FallbackEmbedder, DEFAULT_DIMENSIONS};
let embedder = FallbackEmbedder::new(DEFAULT_DIMENSIONS);
let emb1 = embedder.embed("hello world").unwrap();
let emb2 = embedder.embed("hello world").unwrap();
assert_eq!(emb1, emb2); // DeterministicImplementations§
Trait Implementations§
Source§impl Embedder for FallbackEmbedder
impl Embedder for FallbackEmbedder
Auto Trait Implementations§
impl Freeze for FallbackEmbedder
impl RefUnwindSafe for FallbackEmbedder
impl Send for FallbackEmbedder
impl Sync for FallbackEmbedder
impl Unpin for FallbackEmbedder
impl UnwindSafe for FallbackEmbedder
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
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