Struct truecase::ModelTrainer
source · pub struct ModelTrainer { /* private fields */ }
Expand description
Trainer for new truecasing models.
Use this to create your own models from a set of training sentences. See crate documentation for examples.
Implementations§
source§impl ModelTrainer
impl ModelTrainer
sourcepub fn add_sentences_from_file<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<&mut Self>
pub fn add_sentences_from_file<P: AsRef<Path>>( &mut self, path: P ) -> Result<&mut Self>
Add sentences to the training set from a file.
The file is assumed to have one sentence per line.
sourcepub fn add_sentences_from_iter<I>(&mut self, iter: I) -> &mut Selfwhere
I: Iterator,
I::Item: AsRef<str>,
pub fn add_sentences_from_iter<I>(&mut self, iter: I) -> &mut Selfwhere I: Iterator, I::Item: AsRef<str>,
Add multiple sentences to the training set from an iterator.
sourcepub fn add_sentence(&mut self, sentence: &str) -> &mut Self
pub fn add_sentence(&mut self, sentence: &str) -> &mut Self
Add one sentence to the training set.
sourcepub fn into_model(self) -> Model
pub fn into_model(self) -> Model
Build a model from all gathered statistics.
Trait Implementations§
source§impl Debug for ModelTrainer
impl Debug for ModelTrainer
source§impl Default for ModelTrainer
impl Default for ModelTrainer
source§fn default() -> ModelTrainer
fn default() -> ModelTrainer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ModelTrainer
impl Send for ModelTrainer
impl Sync for ModelTrainer
impl Unpin for ModelTrainer
impl UnwindSafe for ModelTrainer
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