Skip to contents

Abstract class for all tokenizers used with the 'transformers' library.

Value

Does return a new object of this class.

See also

Other Tokenizer: WordPieceTokenizer

Super classes

AIFEMaster -> TokenizerBase -> HuggingFaceTokenizer

Methods

Inherited methods


HuggingFaceTokenizer$create_from_hf()

Creates a tokenizer from a pretrained model

Usage

HuggingFaceTokenizer$create_from_hf(model_dir, tokenizer_type = NULL)

Arguments

model_dir

Path where the model is stored.

tokenizer_type

string Name of the tokenizer belonging to a base model (e.g. BertTokenizer). This parameter is only used if an error occurs during loading as fall back option.

Returns

Does return a new object of this class.


HuggingFaceTokenizer$get_vocab_size()

Vocabulary. size

Usage

HuggingFaceTokenizer$get_vocab_size()

Returns

Returns a int representing the size of the vocabulary.


HuggingFaceTokenizer$clone()

The objects of this class are cloneable with this method.

Usage

HuggingFaceTokenizer$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.