Skip to main content

Text-to-text alignment algorithm for speech recognition error analysis.

Project description

ErrorAlign Logo

Python Versions Coverage Linting PyPI License


Text-to-text alignment algorithm for speech recognition error analysis. ErrorAlign helps you dig deeper into your speech recognition projects by accurately aligning each word in a reference transcript with the model-generated transcript. Unlike traditional methods, such as Levenshtein-based alignment, it is not restricted to simple one-to-one alignment, but can map a single reference word to multiple words or subwords in the model output. This enables quick and reliable identification of error patterns in rare words, names, or domain-specific terms that matter most for your application.

Contents | Installation | Quickstart | Work-in-Progress | Citation and Research |

Installation

pip install error-align

Quickstart

from error_align import error_align

ref = "Some things are worth noting!"
hyp = "Something worth nothing period?"

alignments = error_align(ref, hyp)

Resulting alignments:

Alignment(SUBSTITUTE: "Some" -> "Some"-),
Alignment(SUBSTITUTE: "things" -> -"thing"),
Alignment(DELETE: "are"),
Alignment(MATCH: "worth" == "worth"),
Alignment(SUBSTITUTE: "noting" -> "nothing"),
Alignment(INSERT: "period")

Work-in-Progress

  • Optimization for longform text.
  • Efficient word-level first-pass.
  • C++ version with Python bindings.

Citation and Research

@article{corticph2021alignment,
  title={A Text-To-Text Alignment Algorithm for Better Evaluation of Modern Speech Recognition Systems},
  author={corticph, Lasse and Havtorn, Jakob and Igel, Christian and Maal{\o}e, Lars and Tan, Zheng-Hua},
  journal={arXiv preprint arXiv:2509.24478},
  year={2025}
}

To reproduce results from the paper:

  • Install with extra evaluation dependencies - only supported with Python 3.12:
    • pip install error-align[evaluation]
  • Clone this repository:
    • git clone https://github.com/corticph/error-align.git
  • Navigate to the evaluation directory:
    • cd error-align/evaluation
  • Transcribe a dataset for evaluation. For example:
    • python transcribe_dataset.py --model_name whisper --dataset_name commonvoice --language_code fr
  • Run evaluation script on the output file. For example:
    • python evaluate_dataset.py --transcript_file transcribed_data/whisper_commonvoice_test_fr.parquet

Notes:

  • To reproduce results on the primock57 dataset, first run: python prepare_primock57.py.
  • Use the --help flag to see all available options for transcribe_dataset.py and evaluate_dataset.py.
  • All results reported in the paper are based on the test sets.

Collaborators:



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

error_align-0.1.0b2.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

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

error_align-0.1.0b2-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

Details for the file error_align-0.1.0b2.tar.gz.

File metadata

  • Download URL: error_align-0.1.0b2.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for error_align-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 148866a59d4a3e36cc7187ca32b53943db146d98a5c7b32b486492b25dbb5734
MD5 9239786d2b4ef4bf049fc3e69e910f10
BLAKE2b-256 b005cab47d3cf88429842aecae3999ce518f6598289ee75b23f096b01e478316

See more details on using hashes here.

File details

Details for the file error_align-0.1.0b2-py3-none-any.whl.

File metadata

  • Download URL: error_align-0.1.0b2-py3-none-any.whl
  • Upload date:
  • Size: 45.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for error_align-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 5083703b83aebcf74af3f0f77d84e0e9b9a2a18c26bde140d49231d6489286c4
MD5 c613592a9b64d9ab823799877bfeaca4
BLAKE2b-256 3e307be7f8344b43b5f142f98b261948541ea28c1141209d7cffe0efd4f0d3d4

See more details on using hashes here.

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