pub enum CrossEncoder {
Lexical,
Neural {
model: Arc<Mutex<BertModel>>,
tokenizer: Arc<Tokenizer>,
classifier_weight: Tensor,
classifier_bias: Tensor,
device: Device,
},
}Expand description
Cross-encoder for (query, document) relevance scoring.
Variants§
Lexical
Lightweight lexical cross-encoder using term overlap signals.
Neural
Neural BERT-based cross-encoder (ms-marco-MiniLM-L-6-v2).
Implementations§
Source§impl CrossEncoder
impl CrossEncoder
Sourcepub fn new_neural() -> Self
pub fn new_neural() -> Self
Create a neural cross-encoder by downloading ms-marco-MiniLM-L-6-v2.
Falls back to lexical if download or loading fails.
v0.6.3.1 (P3, G8): when the neural path fails (e.g. HF Hub
unreachable, model checksum mismatch), emit a structured tracing
event reranker.fallback so operators see the silent
neural→lexical degrade. The eprintln remains for backward-compat
startup logs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrossEncoder
impl !RefUnwindSafe for CrossEncoder
impl Send for CrossEncoder
impl Sync for CrossEncoder
impl Unpin for CrossEncoder
impl UnsafeUnpin for CrossEncoder
impl !UnwindSafe for CrossEncoder
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> 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