Skip to main content

Normalization

Enum Normalization 

Source
pub enum Normalization {
    PerKind,
    Global,
}
Expand description

v2.6: how raw_relevance becomes the relevance term of the composite score.

§Per-kind (the rule through v2.5)

Each kind is normalized against the best raw_relevance of that kind. The consequence is that the top memory and the top repo_file both score relevance = 1.0 no matter how good either actually is: on a query where memory has the answer and no file is relevant, the best of the irrelevant files is still promoted to a perfect relevance and competes for budget on the strength of the other three score terms alone.

That is the distortion the lexical and semantic floors exist to compensate for — they prune the weak candidate before normalization can flatter it. A floor is a blunt instrument for this: it is a fixed threshold standing in for a comparison the normalizer could just make.

§Global

One max over all candidates, so relevance means the same thing across kinds and a candidate that is merely the best of a bad kind keeps a low relevance. Nothing else in the pipeline changes.

§Which one runs

Selectable, defaulting to per_kind. Global normalization is the more principled rule and it is still not the default here, for the same reason RRF is not: the house rule is that a ranking change ships with a measurement on a real corpus, and an argument from first principles is not one. [broker] normalization and the per-request override are how a corpus gets to settle it.

Variants§

§

PerKind

Normalize within each capsule kind. Kimetsu’s behaviour through v2.5.

§

Global

Normalize against a single max over every candidate.

Implementations§

Source§

impl Normalization

Source

pub fn from_config(value: &str) -> Self

Parse from config. Unknown values fall back to the default, matching how [broker] fusion treats an unrecognized rule — a typo in a config file must not silently change ranking.

Trait Implementations§

Source§

impl Clone for Normalization

Source§

fn clone(&self) -> Normalization

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Normalization

Source§

impl Debug for Normalization

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Normalization

Source§

fn default() -> Normalization

Returns the “default value” for a type. Read more
Source§

impl Eq for Normalization

Source§

impl PartialEq for Normalization

Source§

fn eq(&self, other: &Normalization) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Normalization

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more