Struct tokenizers::models::wordpiece::WordPieceTrainerBuilder
source · pub struct WordPieceTrainerBuilder { /* private fields */ }
Expand description
A WordPieceTrainerBuilder
can be used to create a WordPieceTrainer
with a custom
configuration.
Implementations§
source§impl WordPieceTrainerBuilder
impl WordPieceTrainerBuilder
sourcepub fn min_frequency(self, frequency: u64) -> Self
pub fn min_frequency(self, frequency: u64) -> Self
Set the expected minimum frequency
sourcepub fn vocab_size(self, size: usize) -> Self
pub fn vocab_size(self, size: usize) -> Self
Set the vocabulary size
sourcepub fn show_progress(self, show: bool) -> Self
pub fn show_progress(self, show: bool) -> Self
Set whether to show progress
sourcepub fn special_tokens(self, tokens: Vec<AddedToken>) -> Self
pub fn special_tokens(self, tokens: Vec<AddedToken>) -> Self
Set the special tokens
sourcepub fn limit_alphabet(self, limit: usize) -> Self
pub fn limit_alphabet(self, limit: usize) -> Self
Set whether to limit the alphabet
sourcepub fn initial_alphabet(self, alphabet: HashSet<char>) -> Self
pub fn initial_alphabet(self, alphabet: HashSet<char>) -> Self
Set the initial alphabet
sourcepub fn continuing_subword_prefix(self, prefix: String) -> Self
pub fn continuing_subword_prefix(self, prefix: String) -> Self
Set the continuing_subword_prefix
sourcepub fn end_of_word_suffix(self, suffix: String) -> Self
pub fn end_of_word_suffix(self, suffix: String) -> Self
Set the end_of_word_suffix
sourcepub fn build(self) -> WordPieceTrainer
pub fn build(self) -> WordPieceTrainer
Constructs the final BpeTrainer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WordPieceTrainerBuilder
impl RefUnwindSafe for WordPieceTrainerBuilder
impl Send for WordPieceTrainerBuilder
impl Sync for WordPieceTrainerBuilder
impl Unpin for WordPieceTrainerBuilder
impl UnwindSafe for WordPieceTrainerBuilder
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