Skip to main content

Open-lattice Indic Word Error Rate (OIWER) with a fast Rust core

Project description

voi_oiwer

The official scorer for OIWER (Orthographically Informed Word Error Rate) as used in the Voice of India (VoI) ASR benchmark (arXiv:2604.19151) — a large-scale evaluation of ASR across 15 Indian languages. This is the same implementation used to produce the benchmark's official results.

OIWER was introduced in prior work (see below) as an orthography-aware alternative to plain WER; VoI adapts it for the benchmark. Instead of penalizing legitimate spelling and transliteration variants, it scores a hypothesis against a lattice of accepted reference variations per word/phrase, so valid orthographic variants aren't counted as errors.

Normalization runs in Python (indicnlp-based); the edit-distance alignment over the lattice is implemented in Rust for speed.

Install

pip install voi_oiwer

Works on CPython 3.8+ (Linux, macOS, Windows). Prebuilt wheels — no Rust toolchain needed.

Usage

from voi_oiwer import oiwer

score, final_h, final_r, final_ops, (ins, dele, sub), \
    total_ref_words, metadata, std_refs = oiwer(
        hypothesis="नमस्ते दुनिया",
        reference_lists=[["नमस्ते"], ["दुनिया", "विश्व"]],   # lattice: variations per slot
        input_language="hindi",
    )
print(score)   # OIWER, as a percentage

Arguments

arg type description
hypothesis str the ASR output text
reference_lists list[list[str]] the reference lattice — one list of accepted variations per slot (a variation may span multiple words)
input_language str a language name, e.g. "hindi", "tamil", "urdu" (see list below)

Returns

A tuple:

(oiwer_score,                    # float — error percentage
 final_h,                        # list[str] — aligned hypothesis words
 final_r,                        # list[str] — aligned reference words (" " = insertion)
 final_ops,                      # list[str] — per slot: 'c' correct, 's' sub, 'd' del, 'i' ins
 (insertions, deletions, substitutions),
 total_reference_words,          # int
 final_metadata,                 # list — [lat_idx, var_idx, word_idx] per reference word (None for insertions)
 standardized_reference_lists)   # list[list[str]] — the normalized lattice used internally

Supported languages

assamese, bengali, bodo, dogri, gujarati, hindi, kannada, kashmiri, konkani, maithili, malayalam, manipuri, marathi, nepali, odia, punjabi, sanskrit, santali, sindhi, tamil, telugu, urdu, chattisgarhi, bhojpuri.

How it works

Scoring runs in two stages. First, text normalization (indicnlp-based) runs in Python — script-specific character handling, punctuation stripping, and Unicode normalization. Then the edit-distance alignment over the reference lattice runs in a compiled Rust core, which is where the speedup comes from. The normalized lattice used internally is returned as standardized_reference_lists so results are inspectable.

The metric, VoI's adaptation of OIWER, and the lattice-based reference design are described in full in the benchmark paper (arXiv:2604.19151).

Development

The Rust core is built with maturin:

pip install maturin
maturin develop --release   # compile the Rust core into your active venv
pytest -q                   # run the test suite

Citation

If you use this metric or the Voice of India benchmark, please cite:

@misc{bhogale2026voiceindialargescalebenchmark,
      title={Voice of India: A Large-Scale Benchmark for Real-World Speech Recognition in India}, 
      author={Kaushal Bhogale and Manas Dhir and Amritansh Walecha and Manmeet Kaur and Vanshika Chhabra and Aaditya Pareek and Hanuman Sidh and Mahima Manik and Sagar Jain and Bhaskar Singh and Utkarsh Singh and Tahir Javed and Shobhit Banga and Mitesh M. Khapra},
      year={2026},
      eprint={2604.19151},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2604.19151}, 
}

This metric builds on the original OIWER formulation:

@misc{bhogale2026orthographicallyinformedevaluationspeechrecognition,
      title={Towards Orthographically-Informed Evaluation of Speech Recognition Systems for Indian Languages}, 
      author={Kaushal Santosh Bhogale and Tahir Javed and Greeshma Susan John and Dhruv Rathi and Akshayasree Padmanaban and Niharika Parasa and Mitesh M. Khapra},
      year={2026},
      eprint={2603.00941},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2603.00941}, 
}

License

MIT © JoshTalks

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

voi_oiwer-0.1.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distributions

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

voi_oiwer-0.1.1-cp38-abi3-win_amd64.whl (113.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (223.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (220.7 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

voi_oiwer-0.1.1-cp38-abi3-macosx_11_0_arm64.whl (207.6 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

voi_oiwer-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl (214.7 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file voi_oiwer-0.1.1.tar.gz.

File metadata

  • Download URL: voi_oiwer-0.1.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for voi_oiwer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6d601d0df1265664a8bcbc77e08eb7b860a9c9cce5445d63c1dda915fa7f4d26
MD5 ff3215811ded24ac14361f9cca6e8764
BLAKE2b-256 0b2acd8717e4456e09ef7abb1eea401dd90275a2b37f9526b6b3821204e544ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for voi_oiwer-0.1.1.tar.gz:

Publisher: release.yml on JoshTalks/voi_oiwer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voi_oiwer-0.1.1-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: voi_oiwer-0.1.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 113.8 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for voi_oiwer-0.1.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8b3b6e5fe95498620084ea2d87fdeab9212c51783772c91062336f4de9ed0105
MD5 e6c0fe7aa502f07de7b6f098e19f0cdf
BLAKE2b-256 c49cf95a6317eaf3c50b8160e1c152aeee115c40b60d137a3e7aa3519a64f266

See more details on using hashes here.

Provenance

The following attestation bundles were made for voi_oiwer-0.1.1-cp38-abi3-win_amd64.whl:

Publisher: release.yml on JoshTalks/voi_oiwer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fd9fef449cf041774f3cd10eb2594c3da8065c67a5abe9985fc66914c575905
MD5 0cec2f570249bd35201018599d261af5
BLAKE2b-256 4fddbe15cfa295d99c3e811c5aea9933f7fcd0e9bcee74f0c35fe666ee3512a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on JoshTalks/voi_oiwer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 57ce8d51e4942858af71462b856096db5f876a51c365a77a8517e019c56d669d
MD5 579085b5f6bcb0e7dbc6ce879c12bd82
BLAKE2b-256 1939578e2b30129b8345f1d6c606572cd77e8cfea4c64f1107dcd285b0836da2

See more details on using hashes here.

Provenance

The following attestation bundles were made for voi_oiwer-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on JoshTalks/voi_oiwer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voi_oiwer-0.1.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for voi_oiwer-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 acb352f2a867bb7f070a0d96f30579eb902200911efbcb4003323df51aed44dc
MD5 a539521291454c1db600733f857c345d
BLAKE2b-256 516c5706932710f8964edb3f7b711073abb3a18b509cbd14e1b64751e539f17d

See more details on using hashes here.

Provenance

The following attestation bundles were made for voi_oiwer-0.1.1-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on JoshTalks/voi_oiwer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file voi_oiwer-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for voi_oiwer-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2afe13894cc6b8013a0757b25b7c3891e0bb7c65c9914e47b125d5e90bad190f
MD5 0f687e8e278e5b51fdcf3e5c71dfb169
BLAKE2b-256 7cae9568bace05296d525716c3428399320041b8521c69c1960a8dd3abc667a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for voi_oiwer-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on JoshTalks/voi_oiwer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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