Skip to main content

Afaan Oromo Tokenizer

Afaan_oromo_tokenizer is a linguistically informed and computationally efficient tokenizer for Afaan Oromo, one of the most widely spoken low-resource languages in Africa.


  • While tokenizers exist for major languages (English, Chinese, etc.), Afan Oromo lacks robust open-source tokenization tools.
  • Afaan_oromo_tokenizer bridges that gap, facilitating NLP research for afaan Oromo.

Features

  • Included: BPE, Unigram, WordPiece
  • Trained on 14 million tokens
  • Total unique tokens in dataset: 420,000
  • 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_encoded = bpe_tokenizer.encode(text)

print("BPE tokens:", bpe_encoded.tokens)
print("BPE ids:", bpe_encoded.ids)

bpe_decoded = bpe_tokenizer.decode(bpe_encoded.ids)
print("BPE decoded:", bpe_decoded)

# --- Unigram tokenizer ---
unigram_tokenizer = ao_tokenizer("unigram")
unigram_encoded = unigram_tokenizer.encode(text)

print("Unigram tokens:", unigram_encoded.tokens)
print("Unigram ids:", unigram_encoded.ids)

unigram_decoded = unigram_tokenizer.decode(unigram_encoded.ids)
print("Unigram decoded:", unigram_decoded)

# --- WordPiece tokenizer ---
wordpiece_tokenizer = ao_tokenizer("wordpiece")
wordpiece_encoded = wordpiece_tokenizer.encode(text)

print("WordPiece tokens:", wordpiece_encoded.tokens)
print("WordPiece ids:", wordpiece_encoded.ids)

wordpiece_decoded = wordpiece_tokenizer.decode(wordpiece_encoded.ids)
print("WordPiece decoded:", wordpiece_decoded)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for afaanoromo-tokenizer 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for afaanoromo-tokenizer 1.1.3
File Size Uploaded Provenance
afaanoromo_tokenizer-1.1.3.tar.gz 1.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for afaanoromo-tokenizer 1.1.3
File Interpreter ABI Platform
afaanoromo_tokenizer-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 3.4 MB

Release files / afaanoromo_tokenizer-1.1.3.tar.gz

Download URL afaanoromo_tokenizer-1.1.3.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
9e42a9ac0649e78b35fdd200e95bb429d2d5091ddbab86bd3c66d5fbdb48d960
BLAKE2b-256 checksum
How to use checksums
ab918c2c5f2415c3cb7854424309cc4bf90a542373f94c344be56d180892f719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / afaanoromo_tokenizer-1.1.3-py3-none-any.whl

Download URL afaanoromo_tokenizer-1.1.3-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d8981ffa411abcdd0c1dee931292a4509d931bc3e55d46d586883036d9d79e55
BLAKE2b-256 checksum
How to use checksums
49b54f5dcb9c6f7e9f2b58faa5eef362fa394a4498f1d497a842ef872021d537
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Security for afaanoromo-tokenizer 1.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page