Skip to main content

A high-performance Python package for calculating Word Error Rate (WER), powered by Rust.

Project description

logo-werx

⚡Lightning fast Word Error Rate Calculations

Meta       uv  Ruff  Powered by Rust  Analytics in Motion

What is WERx?

WERx is a high-performance Python package for calculating Word Error Rate (WER), built with Rust for unmatched speed, memory efficiency, and stability. WERx delivers accurate results with exceptional performance, making it ideal for large-scale evaluation tasks.


🚀 Why Use WERx?

Blazing Fast: Rust-powered core delivers outstanding performance, optimized for large datasets

🧩 Robust: Designed to handle edge cases gracefully, including empty strings and mismatched sequences

📐 Accurate: Carefully tested to ensure consistent and reliable results

🛡️ Production-Ready: Minimal dependencies, memory-efficient, and engineered for stability


⚙️ Installation

You can install WERx either with 'uv' or 'pip'.

Using uv (recommended):

uv pip install werx

Using pip:

pip install werx

✨ Usage

Import the WERx package

Python Code:

import werx

Examples:

1. Single sentence comparison

Python Code:

wer = werx.wer('i love cold pizza', 'i love pizza')
print(wer)

Results Output:

0.25

2. Corpus level Word Error Rate Calculation

Python Code:

ref = ['i love cold pizza','the sugar bear character was popular']
hyp = ['i love pizza','the sugar bare character was popular']
wer = werx.wer(ref, hyp)
print(wer)

Results Output:

0.2

3. Weighted Word Error Rate Calculation (Custom Weights)

Python Code:

ref = ['i love cold pizza', 'the sugar bear character was popular']
hyp = ['i love pizza', 'the sugar bare character was popular']

# Apply lower weight to insertions and deletions, standard weight for substitutions
wer = werx.weighted_wer(
    ref, 
    hyp, 
    insertion_weight=0.5, 
    deletion_weight=0.5, 
    substitution_weight=1.0
)
print(wer)

Results Output:

0.15

📄 License

This project is licensed under the Apache License 2.0.

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

werx-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distributions

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

werx-0.2.0-cp313-cp313-win_amd64.whl (144.9 kB view details)

Uploaded CPython 3.13Windows x86-64

werx-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl (271.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

werx-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (231.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

werx-0.2.0-cp312-cp312-win_amd64.whl (144.9 kB view details)

Uploaded CPython 3.12Windows x86-64

werx-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (271.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

werx-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (231.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

werx-0.2.0-cp311-cp311-win_amd64.whl (144.6 kB view details)

Uploaded CPython 3.11Windows x86-64

werx-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl (273.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

werx-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (233.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

werx-0.2.0-cp310-cp310-win_amd64.whl (144.7 kB view details)

Uploaded CPython 3.10Windows x86-64

werx-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (273.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

werx-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (233.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file werx-0.2.0.tar.gz.

File metadata

  • Download URL: werx-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for werx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c82f9823cf032f5f6c8437443f7b764451cd227fe3eb43083132f9fdf133f5bb
MD5 4d4309e03edbec85590aef2f4ec9c8bb
BLAKE2b-256 cbb698084b9c76538ac0607e8029308456d5e301791923f4dd084f9291c16610

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0.tar.gz:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: werx-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 144.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for werx-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dd57e4c7c401e5be98f7615811e9327d2818d2838b314ab25f9ec1e2ebeeb2b4
MD5 b43598a4734b54e3c3d8af9d7357f614
BLAKE2b-256 6a349d1229af69e49a0e5c1d49ff61d7e01577119691345196deaf1dcf8f440c

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp313-cp313-win_amd64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 12b0652630b50508afea4d6aafdc5d9b12fe220ccada01f6b0215340890049db
MD5 22a76d74de9d9dae6a71227838d795f5
BLAKE2b-256 de965609fa4bac64e86ff6e7f23108fafdbb873ed961a1085fda30449511ab45

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53d2dc1d8434714ac6c9261c13d6ee104c8cc9dbe935d73520589e613bf10ab1
MD5 624a7eefb8bc42fd8da9d34062d8b0b6
BLAKE2b-256 7e71611f91d43b47a952a789d8113fb6bcef068ca53cf39ab6c86c18c63f00d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: werx-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 144.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for werx-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ed50e2501ec6c685e4ff243fbe1177e3225f9d0338d052cfdb41130fd7033000
MD5 e6450a1ac01dd2d02d6a95bb1f226879
BLAKE2b-256 3ac60ef62045f496426f075544e7a25bcb88db700f942efd036e2b2e1cc3c2d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp312-cp312-win_amd64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c01285ad0f93d896a7315a04d64ae62744d723b9d53f8a9f8c610d35f908d7fd
MD5 7d2ab4d1d91fde8c451fe889c413c9ab
BLAKE2b-256 eb512daf4f888b47ba2ca9fd182a8e6a6991ebbdf61091d11645282ebbf84e7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 29f4c464ddd780505454b5431b477e7ccad28211d0227cd71b451ea971970449
MD5 e748be3d4fc84dfe2cce36ffd0190a3f
BLAKE2b-256 65334f6e3f0b4fa60116d9bf661e80ffd05efd7134db124e339ddd60c20c8ad5

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: werx-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 144.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for werx-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bd69ebe052c5b31092e7e3635c28676f0cbeccd9f24ef9146d1b6f9215d872ee
MD5 31cb1b7ea4714a3589102229754549eb
BLAKE2b-256 45036387f241eae7434baa70e958be235fa9a10a55f0a9af9ac72f03b0cbe0d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp311-cp311-win_amd64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bb72f99159a92a6468a277d7a95a960860788c3ac83790c510fdc610ff5b9b39
MD5 cd0b765f1c04816af5d6de628b967da5
BLAKE2b-256 b7cf0f5423beb0e0bf1257bdb497bc0fd08682ad2734dec5fd2ee2d535973c96

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23f8e9993d4cff018107e9f0e6697793f3ce553ccf1ffd939f8d465cd6340664
MD5 8465cefa95ae56bc6019e39b05ec5d63
BLAKE2b-256 c89f5fa74df2b7b96881c1cf811ab24e47f20cf5e6a11f1d377da91c53c798b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: werx-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 144.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for werx-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0a15b58dfd848a9464910ac62d715607f9c346980367ac35b8f753a34f7d5727
MD5 7119c0e94a1de22f82a27c708cccee77
BLAKE2b-256 2851e014b926b1eeeba0353ab3539d9d5df882a175c1220a866710f174eed872

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp310-cp310-win_amd64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d8d88a18af967c0f985bf786063c0aefc257f1fe3f667477d8a3eb0ddc868836
MD5 4fd3b63e4d98b9516beb73f84668a5f0
BLAKE2b-256 8f3adf4e3888639144253a2abab5180c4a59888ddc67a0659eeff03fe29ed9d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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

File details

Details for the file werx-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for werx-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2d0de5be1ed720a4571820c64065928d42394de2482c10623b3920213f613ab
MD5 9a00ae7df73a434c4c2ea2615d3eaf00
BLAKE2b-256 5e78d456fdf9eae639de07b86155948633de65ef28b6a5d94eac4990c5709d5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for werx-0.2.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: CI.yml on analyticsinmotion/werx

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