pub struct CorpusQuality { /* private fields */ }Expand description
Composite metric: a single tuner-friendly score that fuses EVR, bridge coherence, curvature health, and category balance.
Construct via CorpusQuality::new or CorpusQuality::default.
The most recent sub-score breakdown is cached in a Mutex (the
QualityMetric trait requires Send + Sync) and is readable via
Self::last_breakdown after each call to Self::score.
Implementations§
Source§impl CorpusQuality
impl CorpusQuality
Sourcepub fn new(weights: CorpusQualityWeights) -> Self
pub fn new(weights: CorpusQualityWeights) -> Self
Construct with explicit weights. Panics if weights are invalid (non-finite, negative, or all zero) — invalid weights are a programmer error, not a runtime condition the tuner should silently mask.
pub fn weights(&self) -> CorpusQualityWeights
Sourcepub fn last_breakdown(&self) -> Option<CorpusQualityBreakdown>
pub fn last_breakdown(&self) -> Option<CorpusQualityBreakdown>
Snapshot of the sub-scores from the most recent score() call.
Returns None before the first call.
Trait Implementations§
Source§impl Clone for CorpusQuality
impl Clone for CorpusQuality
Source§impl Debug for CorpusQuality
impl Debug for CorpusQuality
Source§impl Default for CorpusQuality
impl Default for CorpusQuality
Source§impl QualityMetric for CorpusQuality
impl QualityMetric for CorpusQuality
Source§fn score(&self, pipeline: &SphereQLPipeline) -> f64
fn score(&self, pipeline: &SphereQLPipeline) -> f64
Evaluate the pipeline. Must return a value in
[0, 1].Source§fn score_with_components(
&self,
pipeline: &SphereQLPipeline,
) -> (f64, Vec<(String, f64, f64)>)
fn score_with_components( &self, pipeline: &SphereQLPipeline, ) -> (f64, Vec<(String, f64, f64)>)
Evaluate the pipeline and report any per-component breakdown in
the same pass. Returns
(score, components) where each
component is (name, weight, component_score). Read moreAuto Trait Implementations§
impl !Freeze for CorpusQuality
impl RefUnwindSafe for CorpusQuality
impl Send for CorpusQuality
impl Sync for CorpusQuality
impl Unpin for CorpusQuality
impl UnsafeUnpin for CorpusQuality
impl UnwindSafe for CorpusQuality
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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