anuragshas
commited on
Commit
•
f788b0f
1
Parent(s):
b7a7f6f
Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,31 @@
|
|
1 |
---
|
|
|
|
|
2 |
license: apache-2.0
|
3 |
tags:
|
4 |
-
-
|
|
|
5 |
datasets:
|
6 |
-
-
|
|
|
|
|
7 |
model-index:
|
8 |
- name: wav2vec2-large-xls-r-300m-or
|
9 |
-
results:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
@@ -69,3 +88,37 @@ The following hyperparameters were used during training:
|
|
69 |
- Pytorch 1.10.0+cu111
|
70 |
- Datasets 1.18.0
|
71 |
- Tokenizers 0.10.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- or
|
4 |
license: apache-2.0
|
5 |
tags:
|
6 |
+
- automatic-speech-recognition
|
7 |
+
- robust-speech-event
|
8 |
datasets:
|
9 |
+
- mozilla-foundation/common_voice_7_0
|
10 |
+
metrics:
|
11 |
+
- wer
|
12 |
model-index:
|
13 |
- name: wav2vec2-large-xls-r-300m-or
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
type: automatic-speech-recognition
|
17 |
+
name: Speech Recognition
|
18 |
+
dataset:
|
19 |
+
type: mozilla-foundation/common_voice_7_0
|
20 |
+
name: Common Voice 7
|
21 |
+
args: or
|
22 |
+
metrics:
|
23 |
+
- type: wer # Required. Example: wer
|
24 |
+
value: 47.31 # Required. Example: 20.90
|
25 |
+
name: Test WER # Optional. Example: Test WER
|
26 |
+
- name: Test CER
|
27 |
+
type: cer
|
28 |
+
value: 11.9
|
29 |
---
|
30 |
|
31 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
88 |
- Pytorch 1.10.0+cu111
|
89 |
- Datasets 1.18.0
|
90 |
- Tokenizers 0.10.3
|
91 |
+
|
92 |
+
#### Evaluation Commands
|
93 |
+
1. To evaluate on `mozilla-foundation/common_voice_7_0` with split `test`
|
94 |
+
|
95 |
+
```bash
|
96 |
+
python eval.py --model_id anuragshas/wav2vec2-large-xls-r-300m-or --dataset mozilla-foundation/common_voice_7_0 --config or --split test
|
97 |
+
```
|
98 |
+
|
99 |
+
|
100 |
+
### Inference With LM
|
101 |
+
|
102 |
+
```python
|
103 |
+
import torch
|
104 |
+
from datasets import load_dataset
|
105 |
+
from transformers import AutoModelForCTC, AutoProcessor
|
106 |
+
import torchaudio.functional as F
|
107 |
+
model_id = "anuragshas/wav2vec2-large-xls-r-300m-or"
|
108 |
+
sample_iter = iter(load_dataset("mozilla-foundation/common_voice_7_0", "or", split="test", streaming=True, use_auth_token=True))
|
109 |
+
sample = next(sample_iter)
|
110 |
+
resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), 48_000, 16_000).numpy()
|
111 |
+
model = AutoModelForCTC.from_pretrained(model_id)
|
112 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
113 |
+
input_values = processor(resampled_audio, return_tensors="pt").input_values
|
114 |
+
with torch.no_grad():
|
115 |
+
logits = model(input_values).logits
|
116 |
+
transcription = processor.batch_decode(logits.numpy()).text
|
117 |
+
# => "ପରରାଏ ବାଲା ଗସ୍ତି ଫାଣ୍ଡି ଗୋପାଳ ପରଠାରୁ ଦେଢ଼କଶ ଦୂର"
|
118 |
+
```
|
119 |
+
|
120 |
+
### Eval results on Common Voice 7 "test" (WER):
|
121 |
+
|
122 |
+
| Without LM | With LM (run `./eval.py`) |
|
123 |
+
|---|---|
|
124 |
+
| 51.92 | 47.31 |
|