Trait finalfusion::compat::word2vec::ReadWord2Vec [−][src]
pub trait ReadWord2Vec<R> where
Self: Sized,
R: BufRead, {
fn read_word2vec_binary(reader: &mut R) -> Result<Self>;
fn read_word2vec_binary_lossy(reader: &mut R) -> Result<Self>;
}
Expand description
Method to construct Embeddings
from a word2vec binary file.
This trait defines an extension to Embeddings
to read the word embeddings
from a file in word2vec binary format.
Required methods
fn read_word2vec_binary(reader: &mut R) -> Result<Self>
fn read_word2vec_binary(reader: &mut R) -> Result<Self>
Read the embeddings from the given buffered reader.
fn read_word2vec_binary_lossy(reader: &mut R) -> Result<Self>
fn read_word2vec_binary_lossy(reader: &mut R) -> Result<Self>
Read the embeddings from the given buffered reader.
In contrast to read_word2vec_binary
, this constructor does
not fail if a token contains invalid UTF-8. Instead, it will
replace invalid UTF-8 characters by the replacement character.