pub struct CharTokenizer {
pub lowercase: bool,
/* private fields */
}Expand description
Character-level tokenizer
Fields§
§lowercase: boolImplementations§
Source§impl CharTokenizer
impl CharTokenizer
pub fn new() -> Self
pub fn lowercase(self, lowercase: bool) -> Self
pub fn fit(&mut self, texts: &[String])
pub fn texts_to_sequences(&self, texts: &[String]) -> Vec<Vec<usize>>
pub fn sequences_to_texts(&self, sequences: &[Vec<usize>]) -> Vec<String>
pub fn vocab_size(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CharTokenizer
impl RefUnwindSafe for CharTokenizer
impl Send for CharTokenizer
impl Sync for CharTokenizer
impl Unpin for CharTokenizer
impl UnwindSafe for CharTokenizer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more