Advanced tokenizer with support for BPE, WordPiece, and Unigram algorithms
Project description
Ultra-Tokenizer
Features
- Multiple Tokenization Algorithms: Supports BPE, WordPiece, and Unigram algorithms
- High Performance: Optimized for speed and memory efficiency
- Easy Integration: Simple API for training and using tokenizers
- Production Ready: Battle-tested with comprehensive test coverage
- Type Hints: Full Python type support for better development experience
Installation
Install the latest stable version from PyPI:
pip install ultra-tokenizer
Quick Start
Basic Usage
from ultra_tokenizer import Tokenizer
# Initialize tokenizer with default settings
tokenizer = Tokenizer()
# Tokenize text
text = "Hello, world! This is Ultra-Tokenizer in action."
tokens = tokenizer.tokenize(text)
print(tokens)
# Output: ['Hello', ',', 'world', '!', 'This', 'is', 'Ultra', '-', 'Token', '##izer', 'in', 'action', '.']
Training a New Tokenizer
from ultra_tokenizer import TokenizerTrainer
# Initialize trainer
trainer = TokenizerTrainer(
vocab_size=30000,
min_frequency=2,
show_progress=True
)
# Train on text files
tokenizer = trainer.train_from_files(["file1.txt", "file2.txt"])
# Save tokenizer
tokenizer.save("my_tokenizer.json")
# Load tokenizer
from ultra_tokenizer import Tokenizer
tokenizer = Tokenizer.from_file("my_tokenizer.json")
Documentation
For detailed documentation, examples, and API reference, please visit:
Contributing
Contributions are welcome! Please read our Contributing Guide to get started.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Contact
For questions or feedback, please open an issue or contact pranav.singh01010101@gmail.com.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 ultra_tokenizer-0.1.2.tar.gz.
File metadata
- Download URL: ultra_tokenizer-0.1.2.tar.gz
- Upload date:
- Size: 37.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ec75c5caaa5cc2876ce6851cb80a16c774f94999ddaed67e2a6e6710a3dce4d
|
|
| MD5 |
60a4b37560abc17b1c766a35bc7c9fe8
|
|
| BLAKE2b-256 |
648c90ea74bfee56dbea9ba3c4cd2922dfc7f9a42b16d0b04202f4021db80f6f
|
File details
Details for the file ultra_tokenizer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ultra_tokenizer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a5375986a47011222051ca32c2aa4fcf78a84e9ac62b614e8a0594ff034997
|
|
| MD5 |
17d518e646c24e7426b1c35e7d6fba04
|
|
| BLAKE2b-256 |
717919fc634d089707409b7b044c91e0bee80eb1f53d99a4302c32539cd75119
|