anuragshas commited on
Commit
bbc669a
1 Parent(s): fb5289d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -3
README.md CHANGED
@@ -6,11 +6,40 @@ tags:
6
  - automatic-speech-recognition
7
  - mozilla-foundation/common_voice_8_0
8
  - generated_from_trainer
 
9
  datasets:
10
- - common_voice
11
  model-index:
12
- - name: ''
13
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ---
15
 
16
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
@@ -76,3 +105,43 @@ The following hyperparameters were used during training:
76
  - Pytorch 1.10.2+cu102
77
  - Datasets 1.18.2.dev0
78
  - Tokenizers 0.11.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  - automatic-speech-recognition
7
  - mozilla-foundation/common_voice_8_0
8
  - generated_from_trainer
9
+ - robust-speech-event
10
  datasets:
11
+ - mozilla-foundation/common_voice_8_0
12
  model-index:
13
+ - name: XLS-R-300M - Bulgarian
14
+ results:
15
+ - task:
16
+ name: Automatic Speech Recognition
17
+ type: automatic-speech-recognition
18
+ dataset:
19
+ name: Common Voice 8
20
+ type: mozilla-foundation/common_voice_8_0
21
+ args: bg
22
+ metrics:
23
+ - name: Test WER
24
+ type: wer
25
+ value: 21.195
26
+ - name: Test CER
27
+ type: cer
28
+ value: 4.786
29
+ - task:
30
+ name: Automatic Speech Recognition
31
+ type: automatic-speech-recognition
32
+ dataset:
33
+ name: Robust Speech Event - Dev Data
34
+ type: speech-recognition-community-v2/dev_data
35
+ args: bg
36
+ metrics:
37
+ - name: Test WER
38
+ type: wer
39
+ value: 32.667
40
+ - name: Test CER
41
+ type: cer
42
+ value: 12.452
43
  ---
44
 
45
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
 
105
  - Pytorch 1.10.2+cu102
106
  - Datasets 1.18.2.dev0
107
  - Tokenizers 0.11.0
108
+
109
+
110
+ #### Evaluation Commands
111
+ 1. To evaluate on `mozilla-foundation/common_voice_8_0` with split `test`
112
+
113
+ ```bash
114
+ python eval.py --model_id anuragshas/wav2vec2-large-xls-r-300m-bg --dataset mozilla-foundation/common_voice_8_0 --config bg --split test
115
+ ```
116
+
117
+ 2. To evaluate on `speech-recognition-community-v2/dev_data`
118
+
119
+ ```bash
120
+ python eval.py --model_id anuragshas/wav2vec2-large-xls-r-300m-bg --dataset speech-recognition-community-v2/dev_data --config bg --split validation --chunk_length_s 5.0 --stride_length_s 1.0
121
+ ```
122
+
123
+ ### Inference With LM
124
+
125
+ ```python
126
+ import torch
127
+ from datasets import load_dataset
128
+ from transformers import AutoModelForCTC, AutoProcessor
129
+ import torchaudio.functional as F
130
+ model_id = "anuragshas/wav2vec2-large-xls-r-300m-bg"
131
+ sample_iter = iter(load_dataset("mozilla-foundation/common_voice_8_0", "bg", split="test", streaming=True, use_auth_token=True))
132
+ sample = next(sample_iter)
133
+ resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), 48_000, 16_000).numpy()
134
+ model = AutoModelForCTC.from_pretrained(model_id)
135
+ processor = AutoProcessor.from_pretrained(model_id)
136
+ input_values = processor(resampled_audio, return_tensors="pt").input_values
137
+ with torch.no_grad():
138
+ logits = model(input_values).logits
139
+ transcription = processor.batch_decode(logits.numpy()).text
140
+ # => "и надутият му ката блоонкурем взе да се събира"
141
+ ```
142
+
143
+ ### Eval results on Common Voice 8 "test" (WER):
144
+
145
+ | Without LM | With LM (run `./eval.py`) |
146
+ |---|---|
147
+ | 30.07 | 21.195 |