Skip to main content

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

Install directly from PyPI:

pip install ao-tokenizer

Usage

from ao_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

afaanoromo_tokenizer-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

afaanoromo_tokenizer-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file afaanoromo_tokenizer-0.1.0.tar.gz.

File metadata

  • Download URL: afaanoromo_tokenizer-0.1.0.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

Hashes for afaanoromo_tokenizer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 afff4ed1420272e251929dad3cafa9f929b2a58120f48d32a83fe790b5c4bfa2
MD5 87d83cd1e979dad1d4327fd8e6e5f3dc
BLAKE2b-256 06d83b3fbc01987851565113fad33ed424d5ba4d2a22532b8aa41032b6c3fd28

See more details on using hashes here.

File details

Details for the file afaanoromo_tokenizer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for afaanoromo_tokenizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdae2b2a90ac6f52c74f480cb43a45537812d595f5096d6438c1ad347c5e551c
MD5 af61de8204f473e307994e92600a9fa1
BLAKE2b-256 4dfdc0620843e555eca29a014f140815ed24db9df594c35dc9acd7a46e85c573

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page