error-align 0.1.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- error_align/__init__.py +7 -0
- error_align/backtrace_graph.py +258 -0
- error_align/baselines/__init__.py +10 -0
- error_align/baselines/optimal_word_alignment.py +111 -0
- error_align/baselines/power/normalize/__init__.py +3 -0
- error_align/baselines/power/normalize/contractions.py +152 -0
- error_align/baselines/power/normalize/normalize.py +295 -0
- error_align/baselines/power/normalize/numbers.py +289 -0
- error_align/baselines/power/power/__init__.py +3 -0
- error_align/baselines/power/power/aligner.py +467 -0
- error_align/baselines/power/power/levenshtein.py +576 -0
- error_align/baselines/power/power/phonemes.py +16 -0
- error_align/baselines/power/power/pronounce.py +85 -0
- error_align/baselines/power/power/punct.py +166 -0
- error_align/baselines/power/power/readers.py +48 -0
- error_align/baselines/power/power/writers.py +259 -0
- error_align/baselines/power_alignment.py +61 -0
- error_align/baselines/rapidfuzz_word_alignment.py +100 -0
- error_align/baselines/utils.py +93 -0
- error_align/edit_distance.py +144 -0
- error_align/error_align.py +495 -0
- error_align/func.py +38 -0
- error_align/utils.py +166 -0
- error_align-0.1.0b1.dist-info/METADATA +161 -0
- error_align-0.1.0b1.dist-info/RECORD +26 -0
- error_align-0.1.0b1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: error-align
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: Text-to-text alignment algorithm for speech recognition error analysis.
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: speech-recognition,text-alignment,NLP,evaluation
|
|
7
|
+
Author: Lasse Borgholt
|
|
8
|
+
Author-email: lb@corti.ai
|
|
9
|
+
Requires-Python: >=3.11,<3.13
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
20
|
+
Provides-Extra: evaluation
|
|
21
|
+
Requires-Dist: backoff (>=2.2.1,<3.0.0) ; extra == "evaluation"
|
|
22
|
+
Requires-Dist: click (>=8.2.1,<9.0.0) ; extra == "evaluation"
|
|
23
|
+
Requires-Dist: datasets (>=3.3.2,<4.0.0) ; extra == "evaluation"
|
|
24
|
+
Requires-Dist: gitpython (>=3.1.45,<4.0.0) ; extra == "evaluation"
|
|
25
|
+
Requires-Dist: librosa (>=0.11.0,<0.12.0) ; extra == "evaluation"
|
|
26
|
+
Requires-Dist: matplotlib (>=3.10.6,<4.0.0) ; extra == "evaluation"
|
|
27
|
+
Requires-Dist: nemo-toolkit[all] (>=2.4.0,<3.0.0) ; extra == "evaluation"
|
|
28
|
+
Requires-Dist: num2words (>=0.5.14,<0.6.0) ; extra == "evaluation"
|
|
29
|
+
Requires-Dist: numpy (>=1.22,<2.0) ; extra == "evaluation"
|
|
30
|
+
Requires-Dist: pandas (>=2.3.1,<3.0.0) ; extra == "evaluation"
|
|
31
|
+
Requires-Dist: pyphen (>=0.17.2,<0.18.0) ; extra == "evaluation"
|
|
32
|
+
Requires-Dist: rapidfuzz (>=3.13.0,<4.0.0) ; extra == "evaluation"
|
|
33
|
+
Requires-Dist: regex (>=2024.11.6,<2025.0.0)
|
|
34
|
+
Requires-Dist: scipy (>=1.16.1,<2.0.0) ; extra == "evaluation"
|
|
35
|
+
Requires-Dist: soundfile (>=0.13.1,<0.14.0) ; extra == "evaluation"
|
|
36
|
+
Requires-Dist: textgrid (>=1.6.1,<2.0.0) ; extra == "evaluation"
|
|
37
|
+
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
|
|
38
|
+
Requires-Dist: transformers (>=4.51.3,<5.0.0) ; extra == "evaluation"
|
|
39
|
+
Requires-Dist: unidecode (>=1.4.0,<2.0.0)
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/logo.svg" alt="ErrorAlign Logo" width="85%"/>
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
<p align="center">
|
|
47
|
+
<img src="https://img.shields.io/badge/python-%203.11%20|%203.12-green" alt="Python Versions">
|
|
48
|
+
<img src="https://img.shields.io/codecov/c/github/borgholt/error-align/main.svg?style=flat-square" alt="Coverage">
|
|
49
|
+
<img src="https://github.com/borgholt/error-align/actions/workflows/lint.yml/badge.svg?branch=main" alt="Linting" style="margin-left:5px;">
|
|
50
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License">
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<br/>
|
|
54
|
+
|
|
55
|
+
**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.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
__Contents__ | [Installation](#installation) | [Quickstart](#quickstart) | [Work-in-Progress](#wip) | [Citation and Research](#citation) |
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<a name="installation">
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
pip install error-align
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<a name="quickstart">
|
|
73
|
+
|
|
74
|
+
## Quickstart
|
|
75
|
+
```python
|
|
76
|
+
from error_align import error_align
|
|
77
|
+
|
|
78
|
+
ref = "Some things are worth noting!"
|
|
79
|
+
hyp = "Something worth nothing period?"
|
|
80
|
+
|
|
81
|
+
alignments = error_align(ref, hyp)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Resulting alignments:
|
|
85
|
+
```python
|
|
86
|
+
Alignment(SUBSTITUTE: "Some" -> "Some"-),
|
|
87
|
+
Alignment(SUBSTITUTE: "things" -> -"thing"),
|
|
88
|
+
Alignment(DELETE: "are"),
|
|
89
|
+
Alignment(MATCH: "worth" == "worth"),
|
|
90
|
+
Alignment(SUBSTITUTE: "noting" -> "nothing"),
|
|
91
|
+
Alignment(INSERT: "period")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
<a name="wip">
|
|
95
|
+
|
|
96
|
+
## Work-in-Progress
|
|
97
|
+
|
|
98
|
+
- Optimization for longform text.
|
|
99
|
+
- Efficient word-level first-pass.
|
|
100
|
+
- C++ version with Python bindings.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<a name="citation">
|
|
105
|
+
|
|
106
|
+
## Citation and Research
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
@article{borgholt2021alignment,
|
|
110
|
+
title={A Text-To-Text Alignment Algorithm for Better Evaluation of Modern Speech Recognition Systems},
|
|
111
|
+
author={Borgholt, Lasse and Havtorn, Jakob and Igel, Christian and Maal{\o}e, Lars and Tan, Zheng-Hua},
|
|
112
|
+
journal={arXiv preprint arXiv:2509.24478},
|
|
113
|
+
year={2025}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
__To reproduce results from the paper:__
|
|
118
|
+
- Install with extra evaluation dependencies:
|
|
119
|
+
- `pip install error-align[evaluation]`
|
|
120
|
+
- Clone this repository:
|
|
121
|
+
- `git clone https://github.com/borgholt/error-align.git`
|
|
122
|
+
- Navigate to the evaluation directory:
|
|
123
|
+
- `cd error-align/evaluation`
|
|
124
|
+
- Transcribe a dataset for evaluation. For example:
|
|
125
|
+
- `python transcribe_dataset.py --model_name whisper --dataset_name commonvoice --language_code fr`
|
|
126
|
+
- Run evaluation script on the output file. For example:
|
|
127
|
+
- `python evaluate_dataset.py --transcript_file transcribed_data/whisper_commonvoice_test_fr.parquet`
|
|
128
|
+
|
|
129
|
+
__Notes:__
|
|
130
|
+
- To reproduce results on the `primock57` dataset, first run: `python prepare_primock57.py`.
|
|
131
|
+
- Use the `--help` flag to see all available options for `transcribe_dataset.py` and `evaluate_dataset.py`.
|
|
132
|
+
- All results reported in the paper are based on the test sets.
|
|
133
|
+
|
|
134
|
+
__Collaborators:__
|
|
135
|
+
|
|
136
|
+
<br/>
|
|
137
|
+
|
|
138
|
+
<div>
|
|
139
|
+
<a href="https://corti.ai">
|
|
140
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/corti.png" alt="Corti" height="75">
|
|
141
|
+
</a>
|
|
142
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/empty.png" alt="" width="30">
|
|
143
|
+
<a href="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/aau.png">
|
|
144
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/aau.png" alt="Aalborg University" height="75">
|
|
145
|
+
</a>
|
|
146
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/empty.png" alt="" width="30">
|
|
147
|
+
<a href="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/pcai.png">
|
|
148
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/pcai.png" alt="Pioneer Centre for Artificial Intelligence" height="75">
|
|
149
|
+
</a>
|
|
150
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/empty.png" alt="" width="30">
|
|
151
|
+
<a href="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/dtu.png">
|
|
152
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/dtu.png" alt="Technical University of Denmark" height="75">
|
|
153
|
+
</a>
|
|
154
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/empty.png" alt="" width="30">
|
|
155
|
+
<a href="https://www.ku.dk/">
|
|
156
|
+
<img src="https://raw.githubusercontent.com/borgholt/error-align/refs/heads/main/.github/assets/ucph.png" alt="University of Copenhagen" height="75">
|
|
157
|
+
</a>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
error_align/__init__.py,sha256=GBZ_L0LVPuwwRnWUnSdeKNXyW5wjXMEAXlyOUeWZwtw,202
|
|
2
|
+
error_align/backtrace_graph.py,sha256=Kd-k6U5T3qZPbfPgeawVcPsRCQpOnEv-xhjxUTSjK38,9409
|
|
3
|
+
error_align/baselines/__init__.py,sha256=-POmzbDZF-Kv7gwkXKYE3-0uBunXtPd7ZAYbAQEqdRg,530
|
|
4
|
+
error_align/baselines/optimal_word_alignment.py,sha256=HWLCO4s2MXBNimk_KGQ9_aQEc1h3jZifq9rTGgDFPLg,4227
|
|
5
|
+
error_align/baselines/power/normalize/__init__.py,sha256=tqe1r9L2GOWu4i9WQaKygRdxg8oTwqHiFzDR7mGJmMg,272
|
|
6
|
+
error_align/baselines/power/normalize/contractions.py,sha256=1rpZdsQx6yXXp19d0wzsIMeQhHVYNXdxIUgB_xqMSGc,5718
|
|
7
|
+
error_align/baselines/power/normalize/normalize.py,sha256=hsvkfaqljZWDFTHwS1tnlz4o-29hjbM4xLQdcIG3lrw,12170
|
|
8
|
+
error_align/baselines/power/normalize/numbers.py,sha256=E0SgzPK2CrLomsD9or-yVRyf52cKn6nDFiKqRrIFQjc,10914
|
|
9
|
+
error_align/baselines/power/power/__init__.py,sha256=kS0D25QjqLgiSsGwTnkO2ic-tyrqFup3icDDfztm3ug,194
|
|
10
|
+
error_align/baselines/power/power/aligner.py,sha256=ccbQiV81q2OElTSsTP_DQqF3oSlAbr3Ulg8K7BdrNw4,24655
|
|
11
|
+
error_align/baselines/power/power/levenshtein.py,sha256=rH0y2KMfYlt-6Tk1oQN6lMWOFX_7zkXrLod1DrHPPdQ,21561
|
|
12
|
+
error_align/baselines/power/power/phonemes.py,sha256=RrgS-g9nvLXv5OFNAuVa5c-OGRxEJoASYbP7fafVa08,748
|
|
13
|
+
error_align/baselines/power/power/pronounce.py,sha256=I1nUAWe0KNlOquxjpqUk_broMXoIrasX88p1bEMkRDI,2983
|
|
14
|
+
error_align/baselines/power/power/punct.py,sha256=AgnS3o2LjRXNqYF7vt16A2fK0ae9-0hOpdz4VviG-zc,8952
|
|
15
|
+
error_align/baselines/power/power/readers.py,sha256=21WUdHz17NWTqbW3USGKGtmhBtCwdY61NIR7O00h4k0,1091
|
|
16
|
+
error_align/baselines/power/power/writers.py,sha256=fgvjN-ew5zIei7S2M-8VBPmszzREFQjy9w5v6ZtAsiI,9930
|
|
17
|
+
error_align/baselines/power_alignment.py,sha256=l_-GWTnzdC_G1UWlYos9lEn_L1UwTxK3if6q7E0xf9E,1997
|
|
18
|
+
error_align/baselines/rapidfuzz_word_alignment.py,sha256=Mm87XiUDP6_UO2KSiCfcz9TdP5PJev7fOkJLYf8vmh8,3923
|
|
19
|
+
error_align/baselines/utils.py,sha256=VPKfVCklIXFId01K6uq6_PMY_qDaavlzB2SuD_5kV_U,2705
|
|
20
|
+
error_align/edit_distance.py,sha256=DZyvVk4h6KdNSRm7ojgWSq9GrFq_Kf4M2z7xD8N3fQ0,5312
|
|
21
|
+
error_align/error_align.py,sha256=H56oVWwff7wRJQRVEoGU3XRsLvuQQjYKIyfQku10I-M,20374
|
|
22
|
+
error_align/func.py,sha256=VIU50MWR5FJwGCXJ3dLA9IGkpJLlmnutvDdZNEyJKMI,1344
|
|
23
|
+
error_align/utils.py,sha256=C1P_sUMOAebtaIvjUjANDs9bL154hf2bNMHEOXjAXPs,4696
|
|
24
|
+
error_align-0.1.0b1.dist-info/METADATA,sha256=jzT5LJsDdGGq3rvxl_JG08NzvYFvoADpRf5NoSbfYpE,7103
|
|
25
|
+
error_align-0.1.0b1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
26
|
+
error_align-0.1.0b1.dist-info/RECORD,,
|