Skip to main content

Pheasa (ភាសា)

Open reference infrastructure for Khmer language AI. Pheasa is the romanization of ភាសា, the Khmer word for "language".

CI License: Apache-2.0

Pheasa aims to provide:

  • a normalizer, so that Khmer text that looks identical is also byte-identical;
  • a benchmark for measuring how well language models handle Khmer;
  • datasets and baselines with documented provenance.

Status: alpha. Version 0.1.0 ships the normalizer (normalization version 1). The benchmark and datasets are in progress.

The problem

Unicode allows several code point orders for the same visible Khmer syllable. Fonts render them alike, but search, deduplication, tokenizers, and evaluation metrics treat them as different strings:

Rendered Code points Bytes (UTF-8)
ខ្មែរ U+1781 U+17D2 U+1798 U+17C2 U+179A e1 9e 81 e1 9f 92 e1 9e 98 e1 9f 82 e1 9e 9a
ខែ្មរ U+1781 U+17C2 U+17D2 U+1798 U+179A e1 9e 81 e1 9f 82 e1 9f 92 e1 9e 98 e1 9e 9a

Unicode NFC does not reconcile these. Pheasa's normalizer does, following the Khmer encoding structure described in Unicode Technical Note #61.

from pheasa import normalize

assert normalize("ខែ្មរ") == normalize("ខ្មែរ") == "ខ្មែរ"

normalize(text, report=True) also returns every change it made, with input offsets and the rule responsible, plus any problems it could not safely fix. Options that remove or rewrite information (zwsp, digits, fold_deprecated) are off by default.

From the command line:

pheasa normalize input.txt -o output.txt --report changes.jsonl
pheasa validate input.txt

See the user guide for options, the report format and issue codes. The rules are specified in spec/normalization.md.

Install

pip install pheasa

Development

Requires uv.

uv sync
make check

Acknowledgements

Pheasa builds on the Khmer encoding structure work by SIL International (khmer-character-specification) and Unicode Technical Note #61.

Citation

If you use Pheasa, please cite it using CITATION.cff.

License

Code is licensed under Apache-2.0. Datasets are released under CC BY 4.0 unless their sources require stricter terms.


Created and maintained by Samputhy Khim (@organi-cs, ORCID 0009-0008-4510-8839).

Metadata

Release files for pheasa 0.1.0

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

Source distribution (sdist)

Source distribution for pheasa 0.1.0
File Size Uploaded Provenance
pheasa-0.1.0.tar.gz 19.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pheasa 0.1.0
File Interpreter ABI Platform
pheasa-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / pheasa-0.1.0.tar.gz

Download URL pheasa-0.1.0.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8f9df33f660c89ab7650f83a5837b0e9d7f17c9684a6338fe2c6346985a22701
BLAKE2b-256 checksum
How to use checksums
8def591fa4a2fb1b02ee0730a6279bafd49d435749f94320e372bd2eabad39e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / pheasa-0.1.0-py3-none-any.whl

Download URL pheasa-0.1.0-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
192721e4db5aa0662184ecbd3ce496b18ab81c208ca8f57e3c028f929be2b4d8
BLAKE2b-256 checksum
How to use checksums
486e5443408e2512f6be8d6fb8b19f77ee87edef92f184b62f160a3ee8cb65ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Security for pheasa 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pheasa-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full 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