Struct wonnx_preprocessing::text::TextTokenizer
source · pub struct TextTokenizer {
pub tokenizer: Tokenizer,
}
Fields§
§tokenizer: Tokenizer
Implementations§
source§impl TextTokenizer
impl TextTokenizer
pub fn new(tokenizer: Tokenizer) -> TextTokenizer
pub fn from_config<P: AsRef<Path>>(path: P) -> Result<TextTokenizer, Error>
pub fn tokenize_question_answer( &self, question: &str, context: &str ) -> Result<Vec<EncodedText>, PreprocessingError>
pub fn decode( &self, encoding: &EncodedText ) -> Result<String, PreprocessingError>
pub fn get_mask_input_for( &self, text: &str, shape: &Shape ) -> Result<Tensor, PreprocessingError>
pub fn get_input_for( &self, text: &str, shape: &Shape ) -> Result<Tensor, PreprocessingError>
Auto Trait Implementations§
impl RefUnwindSafe for TextTokenizer
impl Send for TextTokenizer
impl Sync for TextTokenizer
impl Unpin for TextTokenizer
impl UnwindSafe for TextTokenizer
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