Skip to main content

Meranaw Tokenizer

License: MIT

A Python library for tokenizing the Meranaw language using subword segmentation models (BPE and Unigram). These models were trained only on translated Meranaw religious texts (Quran and Bible). This library was developed as part of a thesis study to facilitate the development of Meranaw NLP applications.

Features

  • Two Algorithms: Supports Byte Pair Encoding (BPE) and Unigram Language Model.
  • Three Sizes: Includes Small, Medium, and Large vocabulary models.
  • Simple API: Easy encoding and decoding functions.

Installation

pip install meranaw-tokenizer

Quick Start

import meranaw_tokenizer as mt

# 1. Load a model (Default: Large Unigram)
tokenizer = mt.load_model()

# 2. Tokenize text
text = "Mapiya kapipita" 
text_lower = text.lower() 
tokens = tokenizer.encode(text_lower, out_type=str)
ids = tokenizer.encode(text_lower, out_type=int)

print(f"Tokens: {tokens}")
print(f"IDs: {ids}")

# 3. Decode back to text
decoded_text = tokenizer.decode(ids)
print(f"Decoded: {decoded_text}")

Available Model Sizes

Size Vocab Count
small 2,315
medium 6,402
large 19,859

Usage Notes

  • Normalization: These models were trained on normalized, lowercase Meranaw text. To maintain low subword fertility (preventing unnecessary fragmentation), always .lower() your string before encoding.
  • Algorithms:
    • Unigram: Uses a probabilistic approach to tokenization.
    • BPE: Uses a frequency-based merging approach.

Author

Jamail M. Cali
MSU Main - Marawi City
Email: cali.jm099@s.msumain.edu.ph

License

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

Metadata

Release files for meranaw-tokenizer 0.1.4

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

Source distribution (sdist)

Source distribution for meranaw-tokenizer 0.1.4
File Size Uploaded Provenance Actions
meranaw_tokenizer-0.1.4.tar.gz 1.6 MB Without provenance Details for meranaw_tokenizer-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meranaw-tokenizer 0.1.4
File Interpreter ABI Platform Actions
meranaw_tokenizer-0.1.4-py3-none-any.whl Python 3 none any Details for meranaw_tokenizer-0.1.4-py3-none-any.whl

Total release size: 3.2 MB

Release files / meranaw_tokenizer-0.1.4.tar.gz

Download URL meranaw_tokenizer-0.1.4.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
e0e2cd5d7d57a38e4507a4f8ad92699ead89f1456800d6e3a3fd016ed068638a
BLAKE2b-256 checksum
How to use checksums
e2445127d25d90385bbdec467550ba6b565472d61e552004dc73650beed999bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / meranaw_tokenizer-0.1.4-py3-none-any.whl

Download URL meranaw_tokenizer-0.1.4-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
66feea2e24c086e4a415a230bb08c567c2d594395b7025514f6dd3982ebad3b5
BLAKE2b-256 checksum
How to use checksums
1576ac3774273ff65548e00078a0d7a646122ec1ec0375237f32570abbff73a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for meranaw-tokenizer 0.1.4

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.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files No provenance

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