[][src]Trait finalfusion::similarity::WordSimilarity

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

Trait for word similarity queries.

Required methods

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

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> WordSimilarity for Embeddings<V, S> where
    V: Vocab,
    S: StorageView
[src]

Loading content...