[−][src]Enum rust_bert::pipelines::common::TokenizerOption
Variants
Bert(BertTokenizer)
Bert Tokenizer
Roberta(RobertaTokenizer)
Roberta Tokenizer
XLMRoberta(XLMRobertaTokenizer)
Roberta Tokenizer
Marian(MarianTokenizer)
Marian Tokenizer
T5(T5Tokenizer)
T5 Tokenizer
Albert(AlbertTokenizer)
Albert Tokenizer
Implementations
impl TokenizerOption
[src]
pub fn from_file(
model_type: ModelType,
vocab_path: &str,
merges_path: Option<&str>,
lower_case: bool
) -> Self
[src]
model_type: ModelType,
vocab_path: &str,
merges_path: Option<&str>,
lower_case: bool
) -> Self
Interface method to load a tokenizer from file
pub fn model_type(&self) -> ModelType
[src]
Returns the model type
pub fn encode_list(
&self,
text_list: Vec<&str>,
max_len: usize,
truncation_strategy: &TruncationStrategy,
stride: usize
) -> Vec<TokenizedInput>
[src]
&self,
text_list: Vec<&str>,
max_len: usize,
truncation_strategy: &TruncationStrategy,
stride: usize
) -> Vec<TokenizedInput>
Interface method
pub fn tokenize(&self, text: &str) -> Vec<String>
[src]
Interface method to tokenization
pub fn build_input_with_special_tokens(
&self,
tokens_1: Vec<i64>,
tokens_2: Option<Vec<i64>>,
offsets_1: Vec<Option<Offset>>,
offsets_2: Option<Vec<Option<Offset>>>,
original_offsets_1: Vec<Vec<OffsetSize>>,
original_offsets_2: Option<Vec<Vec<OffsetSize>>>,
mask_1: Vec<Mask>,
mask_2: Option<Vec<Mask>>
) -> (Vec<i64>, Vec<i8>, Vec<i8>, Vec<Option<Offset>>, Vec<Vec<OffsetSize>>, Vec<Mask>)
[src]
&self,
tokens_1: Vec<i64>,
tokens_2: Option<Vec<i64>>,
offsets_1: Vec<Option<Offset>>,
offsets_2: Option<Vec<Option<Offset>>>,
original_offsets_1: Vec<Vec<OffsetSize>>,
original_offsets_2: Option<Vec<Vec<OffsetSize>>>,
mask_1: Vec<Mask>,
mask_2: Option<Vec<Mask>>
) -> (Vec<i64>, Vec<i8>, Vec<i8>, Vec<Option<Offset>>, Vec<Vec<OffsetSize>>, Vec<Mask>)
Interface method to build input with special tokens
pub fn convert_tokens_to_ids(&self, tokens: &Vec<String>) -> Vec<i64>
[src]
Interface method to convert tokens to ids
pub fn get_pad_id(&self) -> Option<i64>
[src]
Interface method
pub fn get_sep_id(&self) -> Option<i64>
[src]
Interface method
Auto Trait Implementations
impl !RefUnwindSafe for TokenizerOption
impl !Send for TokenizerOption
impl !Sync for TokenizerOption
impl Unpin for TokenizerOption
impl UnwindSafe for TokenizerOption
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,