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: -"thing" -> "things"),
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.0b3.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.0b3-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for error_align-0.1.0b3.tar.gz
Algorithm Hash digest
SHA256 9e9f3d13cb24d67c2c323a5a3d11250e93176ee3e77c01e4dd2cc8a70497c706
MD5 4352d4dfe2ccf5993da6b12bceac09f2
BLAKE2b-256 65c0c24bf757a498ccc54be4cab818ce2656006059028830000152ef41857664

See more details on using hashes here.

File details

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

File metadata

  • Download URL: error_align-0.1.0b3-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.12.1

File hashes

Hashes for error_align-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec77475905b5f14b5c264bf432e6da154b7046335d880fc7f179db5fbfdb2170
MD5 d4bfa7efee044afc1f518022e3da75e7
BLAKE2b-256 6a34f0c07d691a05fd775bf77bf247f30fdcd2881f2f0234fceaa9b25e5f57b3

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