themechanism commited on
Commit
483737b
·
verified ·
1 Parent(s): 67a31ff

Add SFR package and Evaluate metric links

Browse files
Files changed (1) hide show
  1. README.md +53 -10
README.md CHANGED
@@ -60,16 +60,23 @@ configs:
60
 
61
  # Script fidelity benchmark
62
 
63
- Anonymous supplement for the paper "Script Collapse in Multilingual ASR:
64
- Defining and Measuring Script Fidelity Rate."
65
 
66
  Script Fidelity Rate (SFR) measures the fraction of ASR hypothesis characters
67
  that belong to the expected target script. WER measures word edits, while SFR
68
  checks whether the output is written in the target orthography.
69
 
 
 
 
 
 
 
70
  ## Scope
71
 
72
- The benchmark contains 100 evaluated model-language pairs on FLEURS test splits:
 
73
 
74
  | Language | Script | FLEURS code | Role |
75
  |---|---|---|---|
@@ -106,7 +113,7 @@ scripts/
106
  eval_sfr_lid_hybrid.py SFR+LID audit for saved Gemma 4 outputs
107
  run_gemma4.sh Convenience wrapper for the Gemma 4 baseline run
108
  analysis/
109
- sf_results.csv Main result table
110
  gemma4_downstream_mt_summary.csv MT validation summary
111
  gemma4_downstream_mt_correlations.csv MT validation correlations
112
  sfr_lid_hybrid_summary.csv SFR+LID audit summary
@@ -124,6 +131,14 @@ LICENSE CC-BY-4.0 license notice
124
  requirements.txt Python package requirements
125
  ```
126
 
 
 
 
 
 
 
 
 
127
  ## Setup
128
 
129
  Python 3.10 or newer is recommended. Use `uv` for all environment and package
@@ -272,7 +287,11 @@ main figures to the 100 model-language pairs reported in the paper.
272
 
273
  ## Result fields
274
 
275
- `analysis/sf_results.csv` has one row per model-language pair.
 
 
 
 
276
 
277
  | Column | Meaning |
278
  |---|---|
@@ -288,14 +307,38 @@ main figures to the 100 model-language pairs reported in the paper.
288
 
289
  ## SFR library
290
 
291
- The metric implementation is standalone:
 
 
 
 
 
 
292
 
293
  ```python
294
  from script_fidelity import compute_sfr
295
 
296
- compute_sfr("کابل کې ښه هوا ده", "pashto")
297
- compute_sfr("kabul ke sha hawa da", "pashto")
298
- compute_sfr("नमस्ते", "hindi")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  ```
300
 
301
  The validation script has already been run for the submitted artifact. It checks
@@ -316,7 +359,7 @@ PII status, and Responsible AI fields.
316
  ```bibtex
317
  @misc{Anonymous2026ScriptFidelity,
318
  author = {Anonymous},
319
- title = {Script Collapse in Multilingual ASR: Defining and Measuring Script Fidelity Rate},
320
  year = {2026},
321
  note = {Anonymous submission}
322
  }
 
60
 
61
  # Script fidelity benchmark
62
 
63
+ Anonymous supplement for the paper "Script collapse in multilingual ASR:
64
+ A reference-free metric and 100-pair benchmark."
65
 
66
  Script Fidelity Rate (SFR) measures the fraction of ASR hypothesis characters
67
  that belong to the expected target script. WER measures word edits, while SFR
68
  checks whether the output is written in the target orthography.
69
 
70
+ Related resources:
71
+
72
+ - PyPI package: <https://pypi.org/project/script-fidelity/>
73
+ - Hugging Face Evaluate metric: <https://huggingface.co/spaces/themechanism/script_fidelity_rate>
74
+ - Load with Evaluate: `evaluate.load("themechanism/script_fidelity_rate", module_type="metric")`
75
+
76
  ## Scope
77
 
78
+ The paper benchmark contains 100 evaluated model-language pairs on FLEURS test
79
+ splits:
80
 
81
  | Language | Script | FLEURS code | Role |
82
  |---|---|---|---|
 
113
  eval_sfr_lid_hybrid.py SFR+LID audit for saved Gemma 4 outputs
114
  run_gemma4.sh Convenience wrapper for the Gemma 4 baseline run
115
  analysis/
116
+ sf_results.csv Main result table plus six supplemental Pashto rows
117
  gemma4_downstream_mt_summary.csv MT validation summary
118
  gemma4_downstream_mt_correlations.csv MT validation correlations
119
  sfr_lid_hybrid_summary.csv SFR+LID audit summary
 
131
  requirements.txt Python package requirements
132
  ```
133
 
134
+ The general SFR library is published separately as `script-fidelity` on PyPI:
135
+ <https://pypi.org/project/script-fidelity/>. The import name is
136
+ `script_fidelity`. This artifact keeps a bundled `scripts/script_fidelity.py`
137
+ for exact reproduction of the submitted benchmark.
138
+
139
+ The same metric is available as a Hugging Face Evaluate community metric:
140
+ <https://huggingface.co/spaces/themechanism/script_fidelity_rate>.
141
+
142
  ## Setup
143
 
144
  Python 3.10 or newer is recommended. Use `uv` for all environment and package
 
287
 
288
  ## Result fields
289
 
290
+ `analysis/sf_results.csv` has one row per evaluated model-language pair. The
291
+ paper's 100-pair matrix is the subset with `family` in `Whisper`, `MMS`,
292
+ `SeamlessM4T`, or `Gemma4`. The six rows with `family=unknown` are supplemental
293
+ Pashto-only comparisons and are not used in the paper denominator, family
294
+ summaries, heatmap, or collapse counts.
295
 
296
  | Column | Meaning |
297
  |---|---|
 
307
 
308
  ## SFR library
309
 
310
+ For standalone use outside this artifact, install the published package:
311
+
312
+ ```bash
313
+ uv add script-fidelity
314
+ ```
315
+
316
+ Then import it as `script_fidelity`:
317
 
318
  ```python
319
  from script_fidelity import compute_sfr
320
 
321
+ compute_sfr("کابل کې ښه هوا ده", language="ps_af")
322
+ compute_sfr("kabul ke sha hawa da", language="pashto")
323
+ compute_sfr("नमस्ते", language="hindi")
324
+ ```
325
+
326
+ One-off CLI use:
327
+
328
+ ```bash
329
+ uvx --from script-fidelity sfr score --language ps_af --text "کابل کې ښه هوا ده"
330
+ ```
331
+
332
+ Hugging Face Evaluate use:
333
+
334
+ ```python
335
+ import evaluate
336
+
337
+ sfr = evaluate.load("themechanism/script_fidelity_rate", module_type="metric")
338
+ sfr.compute(
339
+ predictions=["کابل کې ښه هوا ده", "romanized output"],
340
+ language="ps_af",
341
+ )
342
  ```
343
 
344
  The validation script has already been run for the submitted artifact. It checks
 
359
  ```bibtex
360
  @misc{Anonymous2026ScriptFidelity,
361
  author = {Anonymous},
362
+ title = {Script collapse in multilingual ASR: A reference-free metric and 100-pair benchmark},
363
  year = {2026},
364
  note = {Anonymous submission}
365
  }