pub struct SemanticVector { /* private fields */ }Expand description
A semantic vector (simplified - in production, use actual embeddings from a model)
Implementations§
Source§impl SemanticVector
impl SemanticVector
Sourcepub fn from_text(text: &str) -> Self
pub fn from_text(text: &str) -> Self
Create a new semantic vector from text
In production, this would call an embedding model (OpenAI, Sentence-BERT, etc.) For now, we use a simplified TF-IDF-like approach with semantic word groups
Sourcepub fn cosine_similarity(&self, other: &SemanticVector) -> f64
pub fn cosine_similarity(&self, other: &SemanticVector) -> f64
Calculate cosine similarity between two vectors
Trait Implementations§
Source§impl Clone for SemanticVector
impl Clone for SemanticVector
Source§fn clone(&self) -> SemanticVector
fn clone(&self) -> SemanticVector
Returns a duplicate of the value. Read more
1.0.0 · 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 SemanticVector
impl RefUnwindSafe for SemanticVector
impl Send for SemanticVector
impl Sync for SemanticVector
impl Unpin for SemanticVector
impl UnwindSafe for SemanticVector
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