UmarRamzan commited on
Commit
47acf89
1 Parent(s): 0cf7378

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -19
README.md CHANGED
@@ -10,29 +10,41 @@ model-index:
10
  results: []
11
  language:
12
  - ur
 
 
13
  ---
14
 
15
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
  should probably proofread and complete it, then remove this comment. -->
17
 
18
- # w2v2-bert-urdu
19
 
20
- This model is a fine-tuned version of [UmarRamzan/w2v2-bert-urdu](https://huggingface.co/UmarRamzan/w2v2-bert-urdu) on an unknown dataset.
21
  It achieves the following results on the evaluation set:
22
  - Loss: 0.3681
23
- - Wer: 0.2573
24
 
25
  ## Model description
26
 
27
- More information needed
28
 
29
- ## Intended uses & limitations
 
 
 
30
 
31
- More information needed
 
 
32
 
33
- ## Training and evaluation data
 
34
 
35
- More information needed
 
 
 
 
36
 
37
  ## Training procedure
38
 
@@ -51,17 +63,6 @@ The following hyperparameters were used during training:
51
  - num_epochs: 1
52
  - mixed_precision_training: Native AMP
53
 
54
- ### Training results
55
-
56
- | Training Loss | Epoch | Step | Validation Loss | Wer |
57
- |:-------------:|:------:|:----:|:---------------:|:------:|
58
- | 0.4362 | 0.1695 | 50 | 0.4144 | 0.3213 |
59
- | 0.3776 | 0.3390 | 100 | 0.4029 | 0.3137 |
60
- | 0.3918 | 0.5085 | 150 | 0.4095 | 0.3060 |
61
- | 0.3968 | 0.6780 | 200 | 0.3961 | 0.3060 |
62
- | 0.3685 | 0.8475 | 250 | 0.3681 | 0.2929 |
63
-
64
-
65
  ### Framework versions
66
 
67
  - Transformers 4.40.2
 
10
  results: []
11
  language:
12
  - ur
13
+ datasets:
14
+ - mozilla-foundation/common_voice_17_0
15
  ---
16
 
17
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
18
  should probably proofread and complete it, then remove this comment. -->
19
 
20
+ # Wav2Vec-Bert-2.0-Urdu
21
 
22
+ This model is a fine-tuned version of [facebook/w2v-bert-2.0](https://huggingface.co/facebook/w2v-bert-2.0) on the Urdu split of the [Common Voice 17](https://huggingface.co/datasets/mozilla-foundation/common_voice_17_0) dataset. The fine-tuned model is enhanced with the addition of an ngram language model that has also been trained on the same dataset.
23
  It achieves the following results on the evaluation set:
24
  - Loss: 0.3681
25
+ - Wer: 0.2407
26
 
27
  ## Model description
28
 
29
+ ## Usage Instructions
30
 
31
+ ```python
32
+ from transformers import AutoFeatureExtractor, Wav2Vec2BertModel
33
+ import torch
34
+ from datasets import load_dataset
35
 
36
+ dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
37
+ dataset = dataset.sort("id")
38
+ sampling_rate = dataset.features["audio"].sampling_rate
39
 
40
+ processor = AutoProcessor.from_pretrained("UmarRamzan/w2v2-bert-ngram-urdu")
41
+ model = Wav2Vec2BertModel.from_pretrained("UmarRamzan/w2v2-bert-ngram-urdu")
42
 
43
+ # audio file is decoded on the fly
44
+ inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
45
+ with torch.no_grad():
46
+ outputs = model(**inputs)
47
+ ```
48
 
49
  ## Training procedure
50
 
 
63
  - num_epochs: 1
64
  - mixed_precision_training: Native AMP
65
 
 
 
 
 
 
 
 
 
 
 
 
66
  ### Framework versions
67
 
68
  - Transformers 4.40.2