kingabzpro commited on
Commit
8ca2db9
1 Parent(s): 31e7005

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -10
README.md CHANGED
@@ -1,12 +1,33 @@
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-Urdu
9
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
@@ -19,20 +40,35 @@ It achieves the following results on the evaluation set:
19
  - Loss: 0.9889
20
  - Wer: 0.5607
21
  - Cer: 0.2370
 
 
22
 
23
- ## Model description
24
-
25
- More information needed
26
 
27
- ## Intended uses & limitations
28
 
29
- More information needed
30
 
31
- ## Training and evaluation data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- More information needed
34
 
35
- ## Training procedure
36
 
37
  ### Training hyperparameters
38
 
@@ -66,3 +102,9 @@ The following hyperparameters were used during training:
66
  - Pytorch 1.10.2+cu102
67
  - Datasets 1.18.2.dev0
68
  - Tokenizers 0.11.0
 
 
 
 
 
 
 
1
  ---
2
+ ---
3
+ language:
4
+ - ur
5
  license: apache-2.0
6
  tags:
7
  - generated_from_trainer
8
+ - robust-speech-event
9
  datasets:
10
+ - mozilla-foundation/common_voice_8_0
11
+ metrics:
12
+ - wer
13
  model-index:
14
  - name: wav2vec2-large-xls-r-300m-Urdu
15
+ results:
16
+ - task:
17
+ type: automatic-speech-recognition
18
+ name: Speech Recognition
19
+ dataset:
20
+ type: mozilla-foundation/common_voice_8_0
21
+ name: Common Voice 8
22
+ args: ur
23
+ metrics:
24
+ - type: wer # Required. Example: wer
25
+ value: 39.89 # Required. Example: 20.90
26
+ name: Test WER # Optional. Example: Test WER
27
+ - name: Test CER
28
+ type: cer
29
+ value: 16.70
30
+ ---
31
  ---
32
 
33
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
 
40
  - Loss: 0.9889
41
  - Wer: 0.5607
42
  - Cer: 0.2370
43
+ #### Evaluation Commands
44
+ 1. To evaluate on `mozilla-foundation/common_voice_8_0` with split `test`
45
 
46
+ ```bash
47
+ python eval.py --model_id kingabzpro/wav2vec2-large-xls-r-300m-Urdu --dataset mozilla-foundation/common_voice_8_0 --config ur --split test
48
+ ```
49
 
 
50
 
51
+ ### Inference With LM
52
 
53
+ ```python
54
+ import torch
55
+ from datasets import load_dataset
56
+ from transformers import AutoModelForCTC, AutoProcessor
57
+ import torchaudio.functional as F
58
+ model_id = "kingabzpro/wav2vec2-large-xls-r-300m-Urdu"
59
+ sample_iter = iter(load_dataset("mozilla-foundation/common_voice_8_0", "ur", split="test", streaming=True, use_auth_token=True))
60
+ sample = next(sample_iter)
61
+ resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), 48_000, 16_000).numpy()
62
+ model = AutoModelForCTC.from_pretrained(model_id)
63
+ processor = AutoProcessor.from_pretrained(model_id)
64
+ input_values = processor(resampled_audio, return_tensors="pt").input_values
65
+ with torch.no_grad():
66
+ logits = model(input_values).logits
67
+ transcription = processor.batch_decode(logits.numpy()).text
68
+ # => "اب نے ٹپیدسون دیتے ہیں"
69
+ ```
70
 
 
71
 
 
72
 
73
  ### Training hyperparameters
74
 
 
102
  - Pytorch 1.10.2+cu102
103
  - Datasets 1.18.2.dev0
104
  - Tokenizers 0.11.0
105
+
106
+ ### Eval results on Common Voice 8 "test" (WER):
107
+
108
+ | Without LM | With LM (run `./eval.py`) |
109
+ |---|---|
110
+ | 52.03 | 39.89 |