Dynamic hybrid tokenizer for micro-datasets
Project description
PHTokenizer
Dynamic Hybrid Tokenizer optimized for micro-datasets (100–500 samples).
Features
- Optimized for small datasets to prevent over-fragmentation.
- Hybrid strategy using atomic tokens and selective BPE.
- Low CPU and RAM usage with LRU cache.
- Supports JSON, CSV, and raw text formats.
Quick Start
from phtokenizer import DynamicHybridTokenizer, TokenizerConfig
config = TokenizerConfig(vocab_size=1000)
tokenizer = DynamicHybridTokenizer(config=config)
data = ["sample text one", "sample text two"]
tokenizer.fit(data)
tokens = tokenizer.tokenize("sample text")
print(tokens)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phtokenizer-1.0.0.tar.gz
(2.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phtokenizer-1.0.0.tar.gz.
File metadata
- Download URL: phtokenizer-1.0.0.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ac5131bd427fb83894ac89ad1966b8b46dee0e090fbdf2f0f76252309b481f5
|
|
| MD5 |
02a8568193525317fb7e3ba218a7fee7
|
|
| BLAKE2b-256 |
db462416ff77db1ed6f2e901d1358119d0f11a8742098051fcbd69a7f1201a6c
|
File details
Details for the file phtokenizer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: phtokenizer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53bbbf8c8420a1d7f91dfb9b8db702d3dc61f69037aaa9ad03a6a955b79335ba
|
|
| MD5 |
c4b68186a2bd9654e2d6db59f3e4af38
|
|
| BLAKE2b-256 |
3ac434ee56ade9398978e3296889851aafb007aebd95b8d720118e6b0334ce30
|