pub struct DocumentTokens {
pub doc_id: u64,
pub tokens: Vec<f32>,
pub n_tokens: usize,
}Expand description
A single document’s worth of token embeddings, ready to index.
tokens is a flat row-major n_tokens × dim buffer. Keeping the
tokens flat mirrors the way docbert already stores ColBERT outputs in
embeddings.db and avoids an intermediate Vec<Vec<f32>> allocation.
Fields§
§doc_id: u64§tokens: Vec<f32>§n_tokens: usizeImplementations§
Trait Implementations§
Source§impl Clone for DocumentTokens
impl Clone for DocumentTokens
Source§fn clone(&self) -> DocumentTokens
fn clone(&self) -> DocumentTokens
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 moreAuto Trait Implementations§
impl Freeze for DocumentTokens
impl RefUnwindSafe for DocumentTokens
impl Send for DocumentTokens
impl Sync for DocumentTokens
impl Unpin for DocumentTokens
impl UnsafeUnpin for DocumentTokens
impl UnwindSafe for DocumentTokens
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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