[−][src]Trait finalfusion::similarity::WordSimilarity
Trait for word similarity queries.
Required methods
fn word_similarity(
&self,
word: &str,
limit: usize
) -> Option<Vec<WordSimilarityResult>>
&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.
Implementors
impl<V, S> WordSimilarity for Embeddings<V, S> where
V: Vocab,
S: StorageView,
[src]
V: Vocab,
S: StorageView,
fn word_similarity(
&self,
word: &str,
limit: usize
) -> Option<Vec<WordSimilarityResult>>
[src]
&self,
word: &str,
limit: usize
) -> Option<Vec<WordSimilarityResult>>