A Meranaw tokenizer library trained specifically on translated religious texts (Bible and Quran).
Project description
Meranaw Tokenizer
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.
Project details
Release history Release notifications | RSS feed
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 meranaw_tokenizer-0.1.4.tar.gz.
File metadata
- Download URL: meranaw_tokenizer-0.1.4.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0e2cd5d7d57a38e4507a4f8ad92699ead89f1456800d6e3a3fd016ed068638a
|
|
| MD5 |
ead5dd53da65f7de42dd2a3acf428362
|
|
| BLAKE2b-256 |
e2445127d25d90385bbdec467550ba6b565472d61e552004dc73650beed999bc
|
File details
Details for the file meranaw_tokenizer-0.1.4-py3-none-any.whl.
File metadata
- Download URL: meranaw_tokenizer-0.1.4-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66feea2e24c086e4a415a230bb08c567c2d594395b7025514f6dd3982ebad3b5
|
|
| MD5 |
66d904a28baf16cf89e9e0d00cc2b396
|
|
| BLAKE2b-256 |
1576ac3774273ff65548e00078a0d7a646122ec1ec0375237f32570abbff73a2
|