pub trait Trainer {
type Model: Model + Sized;
// Required methods
fn should_show_progress(&self) -> bool;
fn train(&self, model: &mut Self::Model) -> Result<Vec<AddedToken>>;
fn feed<I, S, F>(&mut self, iterator: I, process: F) -> Result<()>
where I: Iterator<Item = S> + Send,
S: AsRef<str> + Send,
F: Fn(&str) -> Result<Vec<String>> + Sync;
}Expand description
A Trainer has the responsibility to train a model. We feed it with lines/sentences
and then it can train the given Model.
Required Associated Types§
Required Methods§
Sourcefn should_show_progress(&self) -> bool
fn should_show_progress(&self) -> bool
Whether we should show progress during the training.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.