anuragshas commited on
Commit
55ce724
·
1 Parent(s): 8d3f101

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -2
README.md CHANGED
@@ -1,12 +1,31 @@
1
  ---
 
 
2
  license: apache-2.0
3
  tags:
4
  - generated_from_trainer
 
5
  datasets:
6
- - common_voice
 
 
7
  model-index:
8
  - name: wav2vec2-large-xls-r-300m-mr
9
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
@@ -70,3 +89,37 @@ The following hyperparameters were used during training:
70
  - Pytorch 1.10.0+cu111
71
  - Datasets 1.18.1
72
  - Tokenizers 0.11.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - mr
4
  license: apache-2.0
5
  tags:
6
  - generated_from_trainer
7
+ - robust-speech-event
8
  datasets:
9
+ - mozilla-foundation/common_voice_8_0
10
+ metrics:
11
+ - wer
12
  model-index:
13
  - name: wav2vec2-large-xls-r-300m-mr
14
+ results:
15
+ - task:
16
+ type: automatic-speech-recognition
17
+ name: Speech Recognition
18
+ dataset:
19
+ type: mozilla-foundation/common_voice_8_0
20
+ name: Common Voice 8
21
+ args: mr
22
+ metrics:
23
+ - type: wer # Required. Example: wer
24
+ value: 32.811 # Required. Example: 20.90
25
+ name: Test WER # Optional. Example: Test WER
26
+ - name: Test CER
27
+ type: cer
28
+ value: 7.692
29
  ---
30
 
31
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
 
89
  - Pytorch 1.10.0+cu111
90
  - Datasets 1.18.1
91
  - Tokenizers 0.11.0
92
+
93
+ #### Evaluation Commands
94
+ 1. To evaluate on `mozilla-foundation/common_voice_8_0` with split `test`
95
+
96
+ ```bash
97
+ python eval.py --model_id anuragshas/wav2vec2-large-xls-r-300m-mr --dataset mozilla-foundation/common_voice_8_0 --config mr --split test
98
+ ```
99
+
100
+
101
+ ### Inference With LM
102
+
103
+ ```python
104
+ import torch
105
+ from datasets import load_dataset
106
+ from transformers import AutoModelForCTC, AutoProcessor
107
+ import torchaudio.functional as F
108
+ model_id = "anuragshas/wav2vec2-large-xls-r-300m-mr"
109
+ sample_iter = iter(load_dataset("mozilla-foundation/common_voice_8_0", "mr", split="test", streaming=True, use_auth_token=True))
110
+ sample = next(sample_iter)
111
+ resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), 48_000, 16_000).numpy()
112
+ model = AutoModelForCTC.from_pretrained(model_id)
113
+ processor = AutoProcessor.from_pretrained(model_id)
114
+ input_values = processor(resampled_audio, return_tensors="pt").input_values
115
+ with torch.no_grad():
116
+ logits = model(input_values).logits
117
+ transcription = processor.batch_decode(logits.numpy()).text
118
+ # => "या पानास लेखाचे स्वरूप यायला हावे"
119
+ ```
120
+
121
+ ### Eval results on Common Voice 7 "test" (WER):
122
+
123
+ | Without LM | With LM (run `./eval.py`) |
124
+ |---|---|
125
+ | 49.177 | 32.811 |