pub struct FastText { /* private fields */ }
Implementations§
Source§impl FastText
impl FastText
pub fn new() -> Self
pub fn get_args(&self) -> Args
pub fn load_model(&mut self, filename: &str) -> Result<(), String>
pub fn save_model(&mut self, filename: &str) -> Result<(), String>
pub fn save_output(&mut self, filename: &str) -> Result<(), String>
pub fn save_vectors(&mut self, filename: &str) -> Result<(), String>
pub fn get_dimension(&self) -> isize
pub fn get_word_id(&self, word: &str) -> Result<isize, String>
pub fn get_subword_id(&self, word: &str) -> Result<isize, String>
pub fn is_quant(&self) -> bool
pub fn train(&mut self, args: &Args) -> Result<(), String>
pub fn predict( &self, text: &str, k: i32, threshold: f32, ) -> Result<Vec<Prediction>, String>
pub fn predict_on_words( &self, words: &[i32], k: i32, threshold: f32, ) -> Result<Vec<Prediction>, String>
pub fn get_vocab(&self) -> Result<(Vec<String>, Vec<i64>), String>
pub fn get_labels(&self) -> Result<(Vec<String>, Vec<i64>), String>
pub fn quantize(&mut self, args: &Args) -> Result<(), String>
pub fn get_word_vector(&self, word: &str) -> Result<Vec<f32>, String>
pub fn tokenize(&self, text: &str) -> Result<Vec<String>, String>
pub fn get_sentence_vector(&self, sentence: &str) -> Result<Vec<f32>, String>
pub fn abort(&self)
Trait Implementations§
impl Send for FastText
impl Sync for FastText
Auto Trait Implementations§
impl Freeze for FastText
impl RefUnwindSafe for FastText
impl Unpin for FastText
impl UnwindSafe for FastText
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more