Tokenizer library for Afaan Oromo supporting Unigram, BPE, and WordPiece algorithms.
Project description
Afaan Oromo Tokenizer
A Python library providing tokenizers for the Afaan Oromo language using three popular subword algorithms: BPE, Unigram, and WordPiece. Ideal for NLP tasks.
Features
- Included: BPE, Unigram, WordPiece
- Trained on 13 million tokens
- Supports 425 unique tokens
- Vocabulary size for each tokenizer type: 55,000
Installation
pip install afaanoromo-tokenizer
Usage
from afaanoromo-tokenizer import ao_tokenizer
# Example text
text = "Afaanni oromoo afaan saba guddaati!"
# --- BPE tokenizer ---
bpe_tokenizer = ao_tokenizer("bpe")
bpe_tokens = bpe_tokenizer.encode(text)
print("BPE tokens:", bpe_tokens)
bpe_decoded = bpe_tokenizer.decode(bpe_tokens)
print("BPE decoded:", bpe_decoded)
# --- Unigram tokenizer ---
unigram_tokenizer = ao_tokenizer("unigram")
unigram_tokens = unigram_tokenizer.encode(text)
print("Unigram tokens:", unigram_tokens)
unigram_decoded = unigram_tokenizer.decode(unigram_tokens)
print("Unigram decoded:", unigram_decoded)
# --- WordPiece tokenizer ---
wordpiece_tokenizer = ao_tokenizer("wordpiece")
wordpiece_tokens = wordpiece_tokenizer.encode(text)
print("WordPiece tokens:", wordpiece_tokens)
wordpiece_decoded = wordpiece_tokenizer.decode(wordpiece_tokens)
print("WordPiece decoded:", wordpiece_decoded)
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 afaanoromo_tokenizer-0.1.1.tar.gz.
File metadata
- Download URL: afaanoromo_tokenizer-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0308097f3b3ffe613269759c49d85d5d0b5042bfb2041d7ac5e8b9e645f6008
|
|
| MD5 |
521b8592a0d3dd1ad9e39041dab8a617
|
|
| BLAKE2b-256 |
f3e0612173068f2278a423cd5ed2fdfa781704c22e9aa5a672fa68e61f78e89c
|
File details
Details for the file afaanoromo_tokenizer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: afaanoromo_tokenizer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b331d32f2905c1be8acf0239962c24fd89fc6b6a62fc551e9937d87bf40e54b
|
|
| MD5 |
c1aa6ff611c1e0a7f28e95119bf685ff
|
|
| BLAKE2b-256 |
4737f982f04be36219dd606434c6d558279d6d6ad96b953fd0ab84cb8182d367
|