[][src]Trait rust2vec::text::ReadTextDims

pub trait ReadTextDims<R> where
    Self: Sized,
    R: BufRead
{ fn read_text_dims(reader: &mut R, normalize: bool) -> Result<Self, Error>; }

Method to construct Embeddings from a text file with dimensions.

This trait defines an extension to Embeddings to read the word embeddings from a text stream. The text must contain as the first line the shape of the embedding matrix:

vocab_size n_components

The remainder of the stream should contain one word embedding per line in the following format:

word0 component_1 component_2 ... component_n

Required methods

fn read_text_dims(reader: &mut R, normalize: bool) -> Result<Self, Error>

Read the embeddings from the given buffered reader.

Loading content...

Implementors

impl<R> ReadTextDims<R> for Embeddings<SimpleVocab, NdArray> where
    R: BufRead
[src]

Loading content...