pub struct Word2Vec {
pub embedding_dim: usize,
pub window_size: usize,
pub min_count: usize,
pub learning_rate: f32,
pub epochs: usize,
/* private fields */
}Expand description
Word2Vec Skip-gram model (simplified)
Fields§
§embedding_dim: usize§window_size: usize§min_count: usize§learning_rate: f32§epochs: usizeImplementations§
Source§impl Word2Vec
impl Word2Vec
pub fn new(embedding_dim: usize) -> Self
pub fn window_size(self, size: usize) -> Self
pub fn min_count(self, count: usize) -> Self
pub fn fit(&mut self, texts: &[String])
pub fn get_vector(&self, word: &str) -> Option<&[f32]>
pub fn similarity(&self, word1: &str, word2: &str) -> Option<f32>
pub fn vocab_size(&self) -> usize
Auto Trait Implementations§
impl Freeze for Word2Vec
impl RefUnwindSafe for Word2Vec
impl Send for Word2Vec
impl Sync for Word2Vec
impl Unpin for Word2Vec
impl UnwindSafe for Word2Vec
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> 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