Struct ferritin_featurizers::ProteinTokenizer
source · pub struct ProteinTokenizer { /* private fields */ }
Implementations§
source§impl ProteinTokenizer
impl ProteinTokenizer
pub fn new<P: AsRef<Path>>(tokenizer_path: P) -> Result<Self>
pub fn len(&self) -> usize
pub fn token_to_id(&self, token: &str) -> u32
pub fn id_to_token(&self, id: u32) -> String
pub fn encode( &self, tokens: &[String], max_length: Option<usize>, add_special_tokens: bool, random_truncate: bool, ) -> Result<Tensor>
pub fn decode( &self, token_ids: &[u32], skip_special_tokens: bool, ) -> Result<String>
Auto Trait Implementations§
impl !Freeze for ProteinTokenizer
impl RefUnwindSafe for ProteinTokenizer
impl Send for ProteinTokenizer
impl Sync for ProteinTokenizer
impl Unpin for ProteinTokenizer
impl UnwindSafe for ProteinTokenizer
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