huggingface/tokenizersのQuicktour
wikitext-103 (516MBのテキスト) を使う
wikitext-103-raw-v1.zip
Training the tokenizer
In this tour, we will build and train a Byte-Pair Encoding (BPE) tokenizer.
Here, training the tokenizer means it will learn merge rules by:
トークナイザの訓練とは、トークナイザがマージのルールを学習すること
BPEのアルゴリズムを紹介している
以下は流し読み
Using the tokenizer
encodeメソッド
TemplateProcessing
"[CLS] $A [SEP]" where $A represents our sentence.
Encoding multiple sentences in a batch
encode_batchメソッド
padding
Using a pretrained tokenizer