scribe-eval 0.1.1__tar.gz
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.
- scribe_eval-0.1.1/LICENSE +201 -0
- scribe_eval-0.1.1/PKG-INFO +285 -0
- scribe_eval-0.1.1/README.md +251 -0
- scribe_eval-0.1.1/pyproject.toml +95 -0
- scribe_eval-0.1.1/setup.cfg +4 -0
- scribe_eval-0.1.1/src/scribe/__init__.py +148 -0
- scribe_eval-0.1.1/src/scribe/align.py +224 -0
- scribe_eval-0.1.1/src/scribe/analysis.py +322 -0
- scribe_eval-0.1.1/src/scribe/charts.py +281 -0
- scribe_eval-0.1.1/src/scribe/config/__init__.py +0 -0
- scribe_eval-0.1.1/src/scribe/config/legal_terms.txt +369 -0
- scribe_eval-0.1.1/src/scribe/config/medical_terms.txt +29 -0
- scribe_eval-0.1.1/src/scribe/config/technical_terms.txt +34 -0
- scribe_eval-0.1.1/src/scribe/constants.py +137 -0
- scribe_eval-0.1.1/src/scribe/domain_config.py +277 -0
- scribe_eval-0.1.1/src/scribe/measure.py +346 -0
- scribe_eval-0.1.1/src/scribe/measure_batch.py +430 -0
- scribe_eval-0.1.1/src/scribe/normalize.py +181 -0
- scribe_eval-0.1.1/src/scribe/reporting.py +558 -0
- scribe_eval-0.1.1/src/scribe/tokenize.py +146 -0
- scribe_eval-0.1.1/src/scribe/visualizer/__init__.py +0 -0
- scribe_eval-0.1.1/src/scribe/visualizer/__main__.py +27 -0
- scribe_eval-0.1.1/src/scribe/visualizer/app.py +870 -0
- scribe_eval-0.1.1/src/scribe_eval.egg-info/PKG-INFO +285 -0
- scribe_eval-0.1.1/src/scribe_eval.egg-info/SOURCES.txt +38 -0
- scribe_eval-0.1.1/src/scribe_eval.egg-info/dependency_links.txt +1 -0
- scribe_eval-0.1.1/src/scribe_eval.egg-info/entry_points.txt +2 -0
- scribe_eval-0.1.1/src/scribe_eval.egg-info/requires.txt +11 -0
- scribe_eval-0.1.1/src/scribe_eval.egg-info/top_level.txt +1 -0
- scribe_eval-0.1.1/tests/test_align.py +181 -0
- scribe_eval-0.1.1/tests/test_analysis.py +350 -0
- scribe_eval-0.1.1/tests/test_domain_config.py +566 -0
- scribe_eval-0.1.1/tests/test_imports.py +111 -0
- scribe_eval-0.1.1/tests/test_measure.py +269 -0
- scribe_eval-0.1.1/tests/test_measure_batch.py +509 -0
- scribe_eval-0.1.1/tests/test_normalize.py +56 -0
- scribe_eval-0.1.1/tests/test_packaging.py +43 -0
- scribe_eval-0.1.1/tests/test_paper_cases.py +91 -0
- scribe_eval-0.1.1/tests/test_reporting.py +467 -0
- scribe_eval-0.1.1/tests/test_tokenize.py +114 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend, and
|
|
172
|
+
hold each Contributor harmless for any liability incurred by, or
|
|
173
|
+
claims asserted against, such Contributor by reason of your accepting
|
|
174
|
+
any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Adalat AI
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
200
|
+
implied. See the License for the specific language governing
|
|
201
|
+
permissions and limitations under the License.
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scribe-eval
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Diagnostic ASR evaluation with sandhi-tolerant alignment and categorical error decomposition for Indic and domain-specific speech recognition.
|
|
5
|
+
Author: Kavya Manohar
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/adalat-ai-tech/scribe-eval
|
|
8
|
+
Project-URL: Repository, https://github.com/adalat-ai-tech/scribe-eval
|
|
9
|
+
Project-URL: Issues, https://github.com/adalat-ai-tech/scribe-eval/issues
|
|
10
|
+
Keywords: asr,speech-recognition,evaluation,wer,sandhi,error-analysis,rich-transcription
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: levenshtein>=0.27.1
|
|
25
|
+
Requires-Dist: tabulate>=0.9.0
|
|
26
|
+
Provides-Extra: charts
|
|
27
|
+
Requires-Dist: matplotlib>=3.7.0; extra == "charts"
|
|
28
|
+
Provides-Extra: visualizer
|
|
29
|
+
Requires-Dist: streamlit>=1.53.0; extra == "visualizer"
|
|
30
|
+
Requires-Dist: pandas>=2.0.0; extra == "visualizer"
|
|
31
|
+
Requires-Dist: matplotlib>=3.7.0; extra == "visualizer"
|
|
32
|
+
Requires-Dist: jiwer>=4.0.0; extra == "visualizer"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# SCRIBE — Diagnostic Evaluation for Indic & Domain-Specific ASR
|
|
36
|
+
|
|
37
|
+
[](https://www.python.org/downloads/)
|
|
38
|
+
[](https://github.com/adalat-ai-tech/scribe-eval/blob/main/LICENSE)
|
|
39
|
+
[](https://doi.org/10.5281/zenodo.20765419)
|
|
40
|
+
|
|
41
|
+
`scribe-eval` is the open-source evaluation framework introduced in the SCRIBE
|
|
42
|
+
paper (*Diagnostic Evaluation and Rich Transcription Models for Indic ASR*,
|
|
43
|
+
accepted at Interspeech 2026). It provides fine-grained error metrics for
|
|
44
|
+
ASR systems on Indic languages (Malayalam, Kannada, Hindi, ...) and on
|
|
45
|
+
domain-specific transcription (legal, medical, technical).
|
|
46
|
+
|
|
47
|
+
Token categories are decomposed into base classes (LEXICAL, NUMERAL, PUNCT) and
|
|
48
|
+
optional domain classes (LEGAL, MEDICAL, TECH, or custom). Domain-critical
|
|
49
|
+
terminology is shielded from incorrect splitting and tracked separately — so a
|
|
50
|
+
single misrecognized legal term doesn't inflate your general lexical
|
|
51
|
+
error rate (ER_LEX).
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install scribe-eval # core library
|
|
57
|
+
pip install 'scribe-eval[visualizer]' # adds Streamlit UI
|
|
58
|
+
pip install 'scribe-eval[charts]' # adds matplotlib charts
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The core library depends only on `levenshtein` and `tabulate`. The extras are
|
|
62
|
+
optional and independent of each other.
|
|
63
|
+
|
|
64
|
+
To work on SCRIBE itself, install from source instead:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
git clone https://github.com/adalat-ai-tech/scribe-eval.git
|
|
68
|
+
cd scribe-eval
|
|
69
|
+
pip install -e '.[visualizer,charts]'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Quick Start
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from scribe import compute_cer_scribe, text_error_rates, DomainConfig
|
|
76
|
+
|
|
77
|
+
ref = "charged u/s 302 IPC on 22.05.2023"
|
|
78
|
+
hyp = "charged u/s 303 IPC on 22.05.2023"
|
|
79
|
+
|
|
80
|
+
report = text_error_rates(ref, hyp, DomainConfig.legal())
|
|
81
|
+
|
|
82
|
+
print(f"ER_LEX: {report['LEXICAL']['error_rate']:.2%}")
|
|
83
|
+
print(f"ER_DOMAIN: {report['LEGAL']['error_rate']:.2%}")
|
|
84
|
+
print(f"ER_NUM: {report['NUMERAL']['error_rate']:.2%}")
|
|
85
|
+
|
|
86
|
+
cer = compute_cer_scribe(ref, hyp, DomainConfig.legal())
|
|
87
|
+
print(f"CER_SCRIBE: {cer['cer_scribe']:.2%}")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Features
|
|
91
|
+
|
|
92
|
+
- **Domain-aware tokenization** — shield domain terms from punctuation splitting; track errors separately
|
|
93
|
+
- **Sandhi correction detection** — identifies merged/split words common in Indic ASR
|
|
94
|
+
- **Normalized error rates** — combined denominator prevents misleading metrics for sparse categories
|
|
95
|
+
- **CER_SCRIBE** — character error rate on normalized token streams; format variants cost nothing, and it needs no sandhi machinery to be robust to agglutination
|
|
96
|
+
- **Batch evaluation** — evaluate in-memory records (`evaluate_records`) or JSONL files with per-sample detail and dataset-level aggregation
|
|
97
|
+
- **Interactive visualizer** — Streamlit UI with color-coded alignment, WER_SCRIBE/CER_SCRIBE/Accuracy metric tiles, category breakdown chart, frequent-error tables, and per-sample drill-down
|
|
98
|
+
|
|
99
|
+
## Token Categories
|
|
100
|
+
|
|
101
|
+
| Category | Type | Label | Description |
|
|
102
|
+
|---|---|---|---|
|
|
103
|
+
| LEXICAL | base | ER_LEX | General words (Indic and English) |
|
|
104
|
+
| NUMERAL | base | ER_NUM | Numbers, dates, times (302, 22.05.2023, 10:30) |
|
|
105
|
+
| PUNCT | base | ER_PUNCT | Punctuation marks |
|
|
106
|
+
| LEGAL / MEDICAL / TECH / custom | domain | ER_DOMAIN | Domain terminology — bundled or your own |
|
|
107
|
+
|
|
108
|
+
One domain is active per evaluation: pass a single `DomainConfig`
|
|
109
|
+
(a bundled factory like `DomainConfig.legal()` or your own file via
|
|
110
|
+
`DomainConfig.from_file`); its error rate always reports as **ER_DOMAIN**.
|
|
111
|
+
See [docs/domain-configuration.md](https://github.com/adalat-ai-tech/scribe-eval/blob/main/docs/domain-configuration.md).
|
|
112
|
+
|
|
113
|
+
## Sandhi Awareness
|
|
114
|
+
|
|
115
|
+
Agglutination makes word boundaries unstable in Indic text: the same
|
|
116
|
+
speech can be written as one word or two. SCRIBE detects such two-word
|
|
117
|
+
merges and splits at alignment time and scores them as matches instead
|
|
118
|
+
of errors.
|
|
119
|
+
Real examples from evaluation data (each would count as 100% WER on its
|
|
120
|
+
phrase without detection):
|
|
121
|
+
|
|
122
|
+
| Language | Reference | Hypothesis | Junction |
|
|
123
|
+
|---|---|---|---|
|
|
124
|
+
| Malayalam | അന്യായ പട്ടിക | അന്യായപ്പട്ടിക | gemination |
|
|
125
|
+
| Malayalam | എനിക്ക് അറിയാം | എനിക്കറിയാം | vowel elision |
|
|
126
|
+
| Kannada | ಪ್ರಧಾನ ಮಂತ್ರಿಗಳ | ಪ್ರಧಾನಮಂತ್ರಿಗಳ | compound merge |
|
|
127
|
+
| Kannada | ಮಿತ್ರರಾಷ್ಟ್ರಗಳು | ಮಿತ್ರ ರಾಷ್ಟ್ರಗಳು | compound split |
|
|
128
|
+
| Hindi | भाई साहब | भाईसाहब | compound spacing |
|
|
129
|
+
| Hindi | उस में | उसमें | postposition merge |
|
|
130
|
+
|
|
131
|
+
On an internal benchmark of 48 Malayalam legal dictations (private
|
|
132
|
+
data, not distributed with this repository), sandhi detection recovers
|
|
133
|
+
**3.0 percentage points of WER_SCRIBE** across 377 events that would
|
|
134
|
+
otherwise masquerade as recognition errors. The paired examples above
|
|
135
|
+
are directly reproducible: score any row with `use_sandhi=True` vs
|
|
136
|
+
`use_sandhi=False` in `text_error_rates`.
|
|
137
|
+
|
|
138
|
+
Detection is an orthographic heuristic, not a linguistic analysis — it
|
|
139
|
+
is deliberately lenient and admits some false positives. See
|
|
140
|
+
[Sandhi detection: scope and limitations](https://github.com/adalat-ai-tech/scribe-eval/blob/main/docs/architecture.md#sandhi-detection-scope-and-limitations)
|
|
141
|
+
before relying on sandhi counts.
|
|
142
|
+
|
|
143
|
+
## Domain Configuration
|
|
144
|
+
|
|
145
|
+
Factory methods for bundled domains: `DomainConfig.legal()`, `DomainConfig.medical()`, `DomainConfig.technical()`
|
|
146
|
+
|
|
147
|
+
File-based and custom inline configs are also supported. See [docs/domain-configuration.md](https://github.com/adalat-ai-tech/scribe-eval/blob/main/docs/domain-configuration.md).
|
|
148
|
+
|
|
149
|
+
## Batch Processing
|
|
150
|
+
|
|
151
|
+
Evaluate a dataset from JSONL, one record per line:
|
|
152
|
+
|
|
153
|
+
```jsonl
|
|
154
|
+
{"text": "charged u/s 302 IPC on 22.05.2023", "pred_text": "charged u/s 303 IPC on 22-05-2023", "source_dataset": "legal-dictation"}
|
|
155
|
+
{"text": "witness PW1 deposed before the court", "pred_text": "witness PW 1 deposed before court", "source_dataset": "legal-dictation"}
|
|
156
|
+
{"text": "എനിക്ക് അറിയാം", "pred_text": "എനിക്കറിയാം", "source_dataset": "malayalam-read"}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
from scribe import compute_sample_errors, compute_aggregate_metrics, print_evaluation_summary, DomainConfig
|
|
161
|
+
|
|
162
|
+
results = compute_sample_errors(
|
|
163
|
+
"predictions.jsonl", domain_config=DomainConfig.legal(), collect_error_details=True
|
|
164
|
+
)
|
|
165
|
+
print_evaluation_summary(compute_aggregate_metrics(results))
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
DATASET | ER_LEX | ER_DOMAIN | ER_NUM | ER_PUNCT | WER_SCRIBE | CER_SCRIBE | SANDHI
|
|
170
|
+
OVERALL | 7.14% | 7.14% | 7.14% | N/A | 21.43% | 10.84% | 1
|
|
171
|
+
legal-dictation | 8.33% | 8.33% | 8.33% | N/A | 25.00% | 8.70% | 0
|
|
172
|
+
malayalam-read | 0.00% | N/A | N/A | N/A | 0.00% | 21.43% | 1
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
The Malayalam hypothesis merges a two-word compound; it is counted as a Sandhi
|
|
176
|
+
match, not as errors. `N/A` marks a category with no reference tokens and no
|
|
177
|
+
errors.
|
|
178
|
+
|
|
179
|
+
`evaluate_records()` accepts a list of dicts instead of a file path.
|
|
180
|
+
`output_file=` writes per-sample reports as JSONL. `workers=N` evaluates
|
|
181
|
+
samples in parallel.
|
|
182
|
+
|
|
183
|
+
### Charts
|
|
184
|
+
|
|
185
|
+
Continuing from `results` above, with the `[charts]` extra installed:
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from scribe import aggregate_error_details, compute_error_summary
|
|
189
|
+
from scribe.charts import category_breakdown_chart
|
|
190
|
+
|
|
191
|
+
summary = compute_error_summary(
|
|
192
|
+
compute_aggregate_metrics(results)["overall"], aggregate_error_details(results), top_n=10
|
|
193
|
+
)
|
|
194
|
+
category_breakdown_chart(summary["contributions"], output_path="breakdown.png")
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+

|
|
198
|
+
|
|
199
|
+
One row per category: a normalized outcome bar, an accuracy figure, and that
|
|
200
|
+
category's contribution to WER_SCRIBE. Punctuation is marked "nothing to
|
|
201
|
+
measure" because the reference carries no punctuation tokens.
|
|
202
|
+
|
|
203
|
+
## Examples
|
|
204
|
+
|
|
205
|
+
Runnable scripts live in the repository under
|
|
206
|
+
[`examples/`](https://github.com/adalat-ai-tech/scribe-eval/tree/main/examples),
|
|
207
|
+
covering alignment, single-sample reports, domain configs, and a batch
|
|
208
|
+
command-line tool. They are not installed with the package, so clone the
|
|
209
|
+
repository to use them. See
|
|
210
|
+
[docs/batch-processing.md](https://github.com/adalat-ai-tech/scribe-eval/blob/main/docs/batch-processing.md)
|
|
211
|
+
for the full batch API and output schema.
|
|
212
|
+
|
|
213
|
+
## Interactive Visualizer
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
scribe-visualizer # requires the [visualizer] extra (see Installation)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
See [docs/visualizer.md](https://github.com/adalat-ai-tech/scribe-eval/blob/main/docs/visualizer.md).
|
|
220
|
+
|
|
221
|
+
## Dependencies
|
|
222
|
+
|
|
223
|
+
Core: `levenshtein>=0.27.1`, `tabulate>=0.9.0`
|
|
224
|
+
|
|
225
|
+
Optional extras: `matplotlib` (for `[charts]`), `streamlit`, `pandas`, `matplotlib`, and `jiwer` (for `[visualizer]` — jiwer powers the baseline WER/CER comparison tile).
|
|
226
|
+
|
|
227
|
+
## Development
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
git clone https://github.com/adalat-ai-tech/scribe-eval.git
|
|
231
|
+
cd scribe-eval
|
|
232
|
+
uv sync --all-extras # core + [charts] + [visualizer] + dev tooling
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Running tests
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
uv run pytest # full suite
|
|
239
|
+
uv run pytest tests/test_analysis.py # one file
|
|
240
|
+
uv run pytest -k sandhi # name pattern (-k matches by substring)
|
|
241
|
+
uv run pytest -v # verbose, with each test name
|
|
242
|
+
uv run pytest --cov=scribe # with coverage
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Tests are organised one file per library module under [`tests/`](https://github.com/adalat-ai-tech/scribe-eval/blob/main/tests/), plus
|
|
246
|
+
[`tests/test_paper_cases.py`](https://github.com/adalat-ai-tech/scribe-eval/blob/main/tests/test_paper_cases.py) for end-to-end golden
|
|
247
|
+
cases from the SCRIBE paper. `pytest` itself is part of the `dev` dependency
|
|
248
|
+
group, which `uv sync` installs by default.
|
|
249
|
+
|
|
250
|
+
### Lint and format
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
uv run ruff check src tests examples # lint
|
|
254
|
+
uv run ruff format src tests examples # auto-format
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
See [`docs/architecture.md`](https://github.com/adalat-ai-tech/scribe-eval/blob/main/docs/architecture.md) for the module map and a
|
|
258
|
+
glossary of project-specific terminology (sandhi, combined denominator, WER_SCRIBE, CER_SCRIBE,
|
|
259
|
+
Accuracy, ...).
|
|
260
|
+
|
|
261
|
+
## Citation
|
|
262
|
+
|
|
263
|
+
The SCRIBE paper is accepted at Interspeech 2026. A preprint is available on
|
|
264
|
+
arXiv: <https://arxiv.org/abs/2605.20712>
|
|
265
|
+
|
|
266
|
+
```bibtex
|
|
267
|
+
@article{manohar2026scribe,
|
|
268
|
+
title={SCRIBE: Diagnostic Evaluation and Rich Transcription Models for Indic ASR},
|
|
269
|
+
author={Manohar, Kavya and Bhattacharya, Arghya and Juvekar, Kush and Nethil, Kumarmanas},
|
|
270
|
+
journal={arXiv preprint arXiv:2605.20712},
|
|
271
|
+
year={2026}
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
To cite the software itself, use the "Cite this repository" button on GitHub
|
|
276
|
+
(see [CITATION.cff](https://github.com/adalat-ai-tech/scribe-eval/blob/main/CITATION.cff)) or the Zenodo DOI:
|
|
277
|
+
[10.5281/zenodo.20765419](https://doi.org/10.5281/zenodo.20765419).
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
Licensed under the [Apache License 2.0](https://github.com/adalat-ai-tech/scribe-eval/blob/main/LICENSE).
|
|
282
|
+
|
|
283
|
+
## Acknowledgements
|
|
284
|
+
|
|
285
|
+
Developed as part of the [Adalat AI](https://adalat.ai) initiative for Indic language technologies.
|