UBPE Tokenizer
Project description
UBPE Tokenizer
UBPE -- Universal Byte-Pair Encoding. Universal means that it works not only with strings, but with general sequences too.
The package provides Universal Byte-Pair Encoding tokenizers:
UBPEClassic-- optimized version of classic BPE algorithmUBPE-- novel approach to BPE tokenization which allows you to choose between multiple different variants of encodings according to scores of tf-idf metric or something else; the most optimal encoding from this implementation was shorter than the encoding from classic implementation
Guides and theory
- Description of tokenizer fitting algorithms
- Description of encoding and decoding algorithms for classic and novel approaches
- Google Colab Demo (with precomputed cells)
Roadmap
- Python native implementation
- Cython implementation with C++ backend
- Publish standalone C++ library (it is already usable)
- Other types than
uint32_tas inner token type
- Rust backend with standalone package
- Subdocument tokenization
- RegEx support
- Support for known word tokens in alphabet
- Ignored tokens
- Collaborative training
- Training checkpoints
- Training on large datasets
- Training on splitted datasets
- Other Features:
- One token -- Many subsequences
- Spelling correction support
- Vocabulary pruning
- Examples:
- Demo with visualizaton of pros of the UBPE novel algorithm
- Subdocument tokenization example
Installation
It is planned to deliver different implementations for the algorithm, so the package is divided into general import package (this one), and implementations (for now, Python native and Cython with C++20 backend). To install use:
pip install ubpe[native]
Or,
pip install ubpe[cython]
Bug reports
If you find a bug that occurs under certain circumstances in some tests, please report it.
Contribution
Bugfixes and optimizations are welcomed!
P.S. if you are working at Hugging Face, you can write me and hire me. Please.
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 Distributions
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 ubpe-0.2.4-py3-none-any.whl.
File metadata
- Download URL: ubpe-0.2.4-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c0d87f608d27763811dcc24b2d658b6873014a67b387bcd8826c4175dc85681
|
|
| MD5 |
fa8932308b688e63dc5f7dd305439191
|
|
| BLAKE2b-256 |
ce459dc17db721108e2eb84ea51bc7057cb7ca9bfe9b22dfa69b008de3d1c9c7
|
Provenance
The following attestation bundles were made for ubpe-0.2.4-py3-none-any.whl:
Publisher:
pypi-publish.yml on Scurrra/ubpe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ubpe-0.2.4-py3-none-any.whl -
Subject digest:
9c0d87f608d27763811dcc24b2d658b6873014a67b387bcd8826c4175dc85681 - Sigstore transparency entry: 953474126
- Sigstore integration time:
-
Permalink:
Scurrra/ubpe@b70185de5c3a434cbea2d63de153960d54d44050 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/Scurrra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b70185de5c3a434cbea2d63de153960d54d44050 -
Trigger Event:
release
-
Statement type: