--- license: mit language: - arb - ces - cmn - dan - deu - ell - fra - eng - hun - ind - ita - jpn - nld - pol - por - rus - spa - swe - tur - vie - dig tags: - tokenizer - bpe - flexitok - fineweb2 --- # Byte-Level BPE Tokenizer: ['arb_Arab', 'ces_Latn', 'cmn_Hani', 'dan_Latn', 'deu_Latn', 'ell_Grek', 'fra_Latn', 'eng_Latn', 'hun_Latn', 'ind_Latn', 'ita_Latn', 'jpn_Jpan', 'nld_Latn', 'pol_Latn', 'por_Latn', 'rus_Cyrl', 'spa_Latn', 'swe_Latn', 'tur_Latn', 'vie_Latn', 'digit'] (2K) A **Byte-Level BPE** tokenizer trained on **['arb_Arab', 'ces_Latn', 'cmn_Hani', 'dan_Latn', 'deu_Latn', 'ell_Grek', 'fra_Latn', 'eng_Latn', 'hun_Latn', 'ind_Latn', 'ita_Latn', 'jpn_Jpan', 'nld_Latn', 'pol_Latn', 'por_Latn', 'rus_Cyrl', 'spa_Latn', 'swe_Latn', 'tur_Latn', 'vie_Latn', 'digit']** data from Fineweb-2-HQ. ## Training Details | Parameter | Value | |-----------|-------| | Algorithm | Byte-Level BPE | | Language | `['arb_Arab', 'ces_Latn', 'cmn_Hani', 'dan_Latn', 'deu_Latn', 'ell_Grek', 'fra_Latn', 'eng_Latn', 'hun_Latn', 'ind_Latn', 'ita_Latn', 'jpn_Jpan', 'nld_Latn', 'pol_Latn', 'por_Latn', 'rus_Cyrl', 'spa_Latn', 'swe_Latn', 'tur_Latn', 'vie_Latn', 'digit']` | | Target Vocab Size | 2,000 | | Final Vocab Size | 2,000 | | Pre-tokenizer | custom:addition_split_on_hyphen | | Number handling | ltr_3digit | | Contraction handling | False | | Normalizer | NFC | | Special Tokens | ``, ``, ``, `` | | Training Shards | 42, ['train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl', 'train.chunk.00.jsonl', 'val.chunk.00.jsonl'] | ## Usage ```python from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained("flexitok/maddition_AllL_2000_minimal") tokens = tokenizer.encode("Hello, world!") ``` ## Files - `tokenizer.json` — Full HuggingFace tokenizer - `vocab.json` — Vocabulary mapping - `merges.txt` — BPE merge rules ## Sample Encoding | Text | Tokens | Token IDs | |------|--------|-----------| | `22+9=31\nyirmi iki+dokuz=otuz bir\ntwenty two+nine=thirty one` | `22, +, 9, =, 3, 1, \, ny, ir, mi, Ġ, iki, +, dokuz, =, otuz, Ġ, bir, \, n` | `1827, 13, 27, 31, 21, 19, 62, 533, 505, 667, 223, 723, 13, 718, 31, 1105, 223, 855, 62, 80` | Command used to create this tokenizer: ```bash ['/home/gsa/tokenizers2/flexitok/tokenizer_training/train_tokenizers.py', 'algorithm=bpe', 'vocab_size=2000', 'langs=[arb_Arab,ces_Latn,cmn_Hani,dan_Latn,deu_Latn,ell_Grek,fra_Latn,eng_Latn,hun_Latn,ind_Latn,ita_Latn,jpn_Jpan,nld_Latn,pol_Latn,por_Latn,rus_Cyrl,spa_Latn,swe_Latn,tur_Latn,vie_Latn,digit]', 'data_dir=/scratch/gsa/data/multilingual-addition/', 'output_dir=/scratch/gsa/trained_tokenizers/multilingual_addition', 'pretokenizer=custom:addition_split_on_hyphen', 'number_handling=ltr_3digit', 'add_numbers=false', 'handle_contractions=false', 'unicode_normalization=nfc', 'use_byte_level_regex=false', 'byte_fallback=false', 'strip_zero_width=false', 'cjk_char_split=true', 'add_cjk_chars=false', 'max_lines=-1', 'test_string=22+9=31\\nyirmi iki+dokuz=otuz bir\\ntwenty two+nine=thirty one', 'hf.publish_to_hf=true', 'hf_repo_prefix=flexitok/', 'hf.hf_repo_id=flexitok/maddition_AllL_2000_minimal', 'hf.collections=[flexitok/multilingual_addition_tokenizers_minimal]']