File size: 1,041 Bytes
fa3603e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
832e0be
 
 
 
 
fa3603e
 
 
 
 
832e0be
 
fa3603e
832e0be
 
 
 
 
fa3603e
832e0be
 
fa3603e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: Script Fidelity Rate
sdk: gradio
app_file: app.py
pinned: false
license: mit
tags:
- evaluate
- metric
- automatic-speech-recognition
- unicode
- multilingual-asr
---

# Script Fidelity Rate

This directory is the Hugging Face Evaluate metric module for Script Fidelity
Rate (SFR).

The Python package is published as `script-fidelity` on PyPI:
<https://pypi.org/project/script-fidelity/>. The import name is
`script_fidelity`.

```python
import evaluate

sfr = evaluate.load("./metrics/script_fidelity_rate", module_type="metric")
result = sfr.compute(
    predictions=["کابل کې ښه هوا ده", "this is romanized output"],
    language="ps_af",
)
print(result["sfr_percent"])
```

Hub use:

```python
import evaluate

sfr = evaluate.load("themechanism/script_fidelity_rate", module_type="metric")
sfr.compute(predictions=["کابل کې ښه هوا ده"], language="pashto")
```

Use SFR with WER and CER, not instead of them. SFR checks whether output is in
the intended script. It does not measure lexical accuracy.