pub struct MockSparseEncoder { /* private fields */ }Expand description
Deterministic test-only encoder. Produces a SparseEmbed by
hashing each whitespace-separated token into the first 1024
vocabulary slots with a length-inverse weight
(1.0 / (1.0 + token_len)).
Not a real SPLADE; do not use in benchmarks. Its purpose is to
let Retriever::with_sparse_ranker(...) unit-test the fusion
lane without pulling ONNX Runtime into mnem-core’s test deps.
Trait Implementations§
Source§impl Clone for MockSparseEncoder
impl Clone for MockSparseEncoder
Source§fn clone(&self) -> MockSparseEncoder
fn clone(&self) -> MockSparseEncoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MockSparseEncoder
impl Debug for MockSparseEncoder
Source§impl Default for MockSparseEncoder
impl Default for MockSparseEncoder
Source§impl SparseEncoder for MockSparseEncoder
impl SparseEncoder for MockSparseEncoder
Source§fn model(&self) -> &str
fn model(&self) -> &str
Provider + model identifier. Lowercase, colon-separated by
convention (e.g.
"splade:opensearch-doc-v3-distill",
"bgem3:sparse", "mock:len-inverse").Source§fn vocab_id(&self) -> &str
fn vocab_id(&self) -> &str
Vocabulary identifier. Passed through to
SparseEmbed::vocab_id on every emitted embedding.Source§fn encode(&self, text: &str) -> Result<SparseEmbed, SparseError>
fn encode(&self, text: &str) -> Result<SparseEmbed, SparseError>
Encode a document-side text string into a sparse vector.
This is the path run at ingest time. Read more
Source§fn encode_query(&self, text: &str) -> Result<SparseEmbed, SparseError>
fn encode_query(&self, text: &str) -> Result<SparseEmbed, SparseError>
Encode a query-side text string into a sparse vector. Read more
Auto Trait Implementations§
impl Freeze for MockSparseEncoder
impl RefUnwindSafe for MockSparseEncoder
impl Send for MockSparseEncoder
impl Sync for MockSparseEncoder
impl Unpin for MockSparseEncoder
impl UnsafeUnpin for MockSparseEncoder
impl UnwindSafe for MockSparseEncoder
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