Lao OCR Evaluation Tool with CER/WER and visual alignment
Project description
Lao Text Evaluation 🧪🇱🇦
Grapheme-aware evaluation toolkit for Lao OCR or text models — including CER, WER, character-level error breakdowns, and alignment visualizations.
✨ Features
- ✅ Character Error Rate (CER) and Word Error Rate (WER)
- ✅ Grapheme-level alignment using Unicode-aware splitting
- ✅ Lao-specific character classification: consonants, vowels, tone marks
- ✅ Visual alignment plots (color-coded matches, insertions, deletions, substitutions)
- ✅ CLI interface for single or batch file comparison
- ✅ Export results to CSV
- ✅ Generate sample data for quick testing
🛠 Installation
pip install lao-text-evaluation
🚀 CLI Usage
🔹 Generate Sample Data
Quickly create example ground truth and prediction files for testing:
python -m lao_text_evaluation.cli --generate-sample-data
- This will create
sample/data/gtandsample/data/predfolders with example.txtfiles.
🔹 Single Pair Evaluation
python -m lao_text_evaluation.cli \
--gt "ນ້ຳໃຈ" \
--pred "ນ້ຳໃສ່" \
--filename "sample1" \
--plot \
--plot-dir ./plots
🔹 Batch Folder Mode
python -m lao_text_evaluation.cli \
--gt-path sample/data/gt \
--pred-path sample/data/pred \
--plot-sample 5 \
--plot-dir ./plots \
--save-csv results.csv \
--append-csv
.txtfiles must match by filename between ground truth and predictions.- Plot images (optional) will be saved to
--plot-dir.
🧪 Output Example
- ✅ CSV format:
Filename,CER,WER,Removed_*,Inserted_*,Replaced Graphemes - 🖼️ Visual plot: character alignment with color-coded errors
🧩 Module Usage (Python API)
from lao_text_evaluation.metrics import compute_cer, analyze_grapheme_errors
compute_cer("ນ້ຳໃຈ", "ນ້ຳໃສ່")
📂 Folder Structure
lao_text_evaluation/
├── metrics.py
├── utils.py
├── plotting.py
├── config.py
├── cli.py
📜 License
MIT License © 2025 Khonepaseuth Sounakhen
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 lao_text_evaluation-0.2.1.tar.gz.
File metadata
- Download URL: lao_text_evaluation-0.2.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
313735dc35d5978fdde42d0818c37982555a5b7812f380802c1ac6b0092a628d
|
|
| MD5 |
da55a10f024bfedf7585902078d98b5e
|
|
| BLAKE2b-256 |
fcde301b31834d3984318e32fccfcc626de67e952282e7e9ff41884719c0a3c0
|
File details
Details for the file lao_text_evaluation-0.2.1-py3-none-any.whl.
File metadata
- Download URL: lao_text_evaluation-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef78688285d4d467a802df2a3716c84ffd3fdaa13b6964babb9747fdd81985e2
|
|
| MD5 |
a3e8d4ce077a62c4c1cc8792009e09f1
|
|
| BLAKE2b-256 |
8290c667839f5287b50314d743754536ec7316028b6cf2825d27513be0b780f6
|