Trait tokenizers::tokenizer::Trainer
source · 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.
Object Safety§
This trait is not object safe.