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
impl Normalization
Sourcepub fn from_config(value: &str) -> Self
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
impl Clone for Normalization
Source§fn clone(&self) -> Normalization
fn clone(&self) -> Normalization
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more