CoolFace
Modelpublic

ByteMeHarder-404/tokenizers

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
Model Card

Basic Tokenizers Collection

This repository contains three different tokenizers trained and wrapped for experimentation and educational purposes:

๐Ÿ“ฆ Contents

  • โ€”WordPiece Tokenizer Path: ByteMeHarder-404/tokenizers/wordpiece Classic subword tokenizer (used in BERT). Splits words into subword units based on frequency, ensuring full coverage with a compact vocab.
  • โ€”Byte-Pair Encoding (BPE) Tokenizer Path: ByteMeHarder-404/tokenizers/bpe Uses byte-level BPE, similar to GPT-2 and RoBERTa. Handles any UTF-8 character without unknown tokens by working directly on bytes.
  • โ€”XLNet-Style Tokenizer Path: ByteMeHarder-404/tokenizers/xlnet Follows the XLNet tokenization approach, leveraging sentencepiece-like segmentation.

๐Ÿš€ Usage

You can load each tokenizer with transformers:

python
from transformers import PreTrainedTokenizerFast

# WordPiece
tok_wordpiece = PreTrainedTokenizerFast.from_pretrained("ByteMeHarder-404/tokenizers/wordpiece")

# BPE
tok_bpe = PreTrainedTokenizerFast.from_pretrained("ByteMeHarder-404/tokenizers/bpe")

# XLNet-style
tok_xlnet = PreTrainedTokenizerFast.from_pretrained("ByteMeHarder-404/tokenizers/xlnet")

๐Ÿ“š Notes

  • โ€”These tokenizers are minimal examples and not pretrained with embeddings or models.
  • โ€”Intended for experimentation, educational purposes, and as a foundation for building custom models.
  • โ€”You can extend them by training a new vocabulary on your dataset.