[][src]Trait rust2vec::similarity::Similarity

pub trait Similarity {
    fn similarity(
        &self,
        word: &str,
        limit: usize
    ) -> Option<Vec<WordSimilarity>>; }

Trait for similarity queries.

Required methods

fn similarity(&self, word: &str, limit: usize) -> Option<Vec<WordSimilarity>>

Find words that are similar to the query word.

The similarity between two words is defined by the dot product of the embeddings. If the vectors are unit vectors (e.g. by virtue of calling normalize), this is the cosine similarity. At most, limit results are returned.

Loading content...

Implementors

impl<V, S> Similarity for Embeddings<V, S> where
    V: Vocab,
    S: StorageView
[src]

Loading content...