[][src]Trait finalfusion::compat::text::ReadText

pub trait ReadText<R> where
    Self: Sized,
    R: BufRead
{ fn read_text(reader: &mut R) -> Result<Self>;
fn read_text_lossy(reader: &mut R) -> Result<Self>; }

Method to construct Embeddings from a text file.

This trait defines an extension to Embeddings to read the word embeddings from a text stream. The text should contain one word embedding per line in the following format:

word0 component_1 component_2 ... component_n

Required methods

fn read_text(reader: &mut R) -> Result<Self>

Read the embeddings from the given buffered reader.

fn read_text_lossy(reader: &mut R) -> Result<Self>

Read the embeddings from the given buffered reader.

In contrast to read_text, this constructor does not fail if a token contains invalid UTF-8. Instead, it will replace invalid UTF-8 characters by the replacement character.

Loading content...

Implementors

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

Loading content...