These types represent all the different kinds of sequence that can be used as input of a Tokenizer.
Globally, any sequence can be either a string or a list of strings, according to the operating
mode of the tokenizer: raw text
vs pre-tokenized
.
tokenizers.TextInputSequence
A str
that represents an input sequence
tokenizers.PreTokenizedInputSequence
A pre-tokenized input sequence. Can be one of:
List
of str
Tuple
of str
alias of Union[List[str], Tuple[str]]
.
tokenizers.InputSequence
Represents all the possible types of input sequences for encoding. Can be:
is_pretokenized=False
: TextInputSequenceis_pretokenized=True
: PreTokenizedInputSequencealias of Union[str, List[str], Tuple[str]]
.