pub trait SentenceEmbedder: Sized {
    // Required methods
    fn embedding_size(&self) -> usize;
    fn fit<S>(self, sentences: &[S]) -> Result<Self>
       where S: AsRef<str>;
    fn embeddings<I, S>(&self, sentences: I) -> Result<Array2<Float>>
       where I: IntoIterator<Item = S>,
             S: AsRef<str>;
}
Expand description

Common behavior of our models for sentence embeddings.

Required Methods§

source

fn embedding_size(&self) -> usize

Returns the number of dimensions for sentence embeddings.

source

fn fit<S>(self, sentences: &[S]) -> Result<Self>
where S: AsRef<str>,

Fits the model with input sentences.

source

fn embeddings<I, S>(&self, sentences: I) -> Result<Array2<Float>>
where I: IntoIterator<Item = S>, S: AsRef<str>,

Computes embeddings for input sentences using the fitted model.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'w, 'p, W, P> SentenceEmbedder for Sif<'w, 'p, W, P>

source§

impl<'w, 'p, W, P> SentenceEmbedder for USif<'w, 'p, W, P>