[][src]Trait rust2vec::similarity::Analogy

pub trait Analogy {
    fn analogy(
        &self,
        word1: &str,
        word2: &str,
        word3: &str,
        limit: usize
    ) -> Option<Vec<WordSimilarity>>; }

Trait for analogy queries.

Required methods

fn analogy(
    &self,
    word1: &str,
    word2: &str,
    word3: &str,
    limit: usize
) -> Option<Vec<WordSimilarity>>

Perform an analogy query.

This method returns words that are close in vector space the analogy query word1 is to word2 as word3 is to ?. More concretely, it searches embeddings that are similar to:

embedding(word2) - embedding(word1) + embedding(word3)

At most, limit results are returned.

Loading content...

Implementors

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

Loading content...