pub struct AvgLenEstimate {
pub mean: f64,
pub docs: usize,
}Expand description
Mean post-pipeline token count over sampled document texts — the
estimator for a corpus-true avg_len.
“Real data” in one function: pass the actual field texts (e.g. from a
SCROLL sample) and get the average doc_len the TF formula consumes,
measured with the same pipeline that will embed the writes. Returns
None when the sample holds no documents or no tokens at all (an empty
corpus has no meaningful average — keep the default instead of
dividing by zero or storing avg_len = 0, which validation rejects).
Fields§
§mean: f64Mean post-pipeline tokens per document (> 0 when returned).
docs: usizeDocuments measured.
Trait Implementations§
Source§impl Clone for AvgLenEstimate
impl Clone for AvgLenEstimate
Source§fn clone(&self) -> AvgLenEstimate
fn clone(&self) -> AvgLenEstimate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AvgLenEstimate
Source§impl Debug for AvgLenEstimate
impl Debug for AvgLenEstimate
Source§impl PartialEq for AvgLenEstimate
impl PartialEq for AvgLenEstimate
impl StructuralPartialEq for AvgLenEstimate
Auto Trait Implementations§
impl Freeze for AvgLenEstimate
impl RefUnwindSafe for AvgLenEstimate
impl Send for AvgLenEstimate
impl Sync for AvgLenEstimate
impl Unpin for AvgLenEstimate
impl UnsafeUnpin for AvgLenEstimate
impl UnwindSafe for AvgLenEstimate
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