Update README.md
Browse files
README.md
CHANGED
@@ -6,199 +6,157 @@ tags:
|
|
6 |
- asr
|
7 |
- peft
|
8 |
- lora
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
---
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
14 |
-
|
15 |
-
|
16 |
|
17 |
## Model Details
|
18 |
|
19 |
### Model Description
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
24 |
|
25 |
-
- **Developed by:**
|
26 |
-
- **
|
27 |
-
- **
|
28 |
-
- **
|
29 |
-
- **
|
30 |
-
- **License:** [More Information Needed]
|
31 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
32 |
|
33 |
-
### Model Sources
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
- **Repository:** [More Information Needed]
|
38 |
-
- **Paper [optional]:** [More Information Needed]
|
39 |
-
- **Demo [optional]:** [More Information Needed]
|
40 |
|
41 |
## Uses
|
42 |
|
43 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
44 |
-
|
45 |
### Direct Use
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
[More Information Needed]
|
50 |
|
51 |
-
### Downstream Use
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
[More Information Needed]
|
56 |
|
57 |
### Out-of-Scope Use
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
## Bias, Risks, and Limitations
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
|
69 |
### Recommendations
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
## How to Get Started with the Model
|
76 |
|
77 |
-
|
|
|
|
|
78 |
|
79 |
-
|
|
|
80 |
|
81 |
-
|
|
|
82 |
|
83 |
-
|
|
|
|
|
84 |
|
85 |
-
|
|
|
|
|
|
|
86 |
|
87 |
-
|
|
|
88 |
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
#### Preprocessing [optional]
|
94 |
-
|
95 |
-
[More Information Needed]
|
96 |
|
|
|
97 |
|
98 |
-
|
99 |
|
100 |
-
- **
|
|
|
|
|
101 |
|
102 |
-
|
103 |
|
104 |
-
|
105 |
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
## Evaluation
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
### Testing Data, Factors & Metrics
|
113 |
-
|
114 |
-
#### Testing Data
|
115 |
-
|
116 |
-
<!-- This should link to a Dataset Card if possible. -->
|
117 |
-
|
118 |
-
[More Information Needed]
|
119 |
-
|
120 |
-
#### Factors
|
121 |
-
|
122 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
#### Metrics
|
127 |
-
|
128 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
129 |
-
|
130 |
-
[More Information Needed]
|
131 |
|
132 |
### Results
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
## Model Examination [optional]
|
141 |
|
142 |
-
|
143 |
-
|
144 |
-
[More Information Needed]
|
145 |
|
146 |
## Environmental Impact
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
151 |
-
|
152 |
-
- **Hardware Type:** [More Information Needed]
|
153 |
-
- **Hours used:** [More Information Needed]
|
154 |
-
- **Cloud Provider:** [More Information Needed]
|
155 |
-
- **Compute Region:** [More Information Needed]
|
156 |
-
- **Carbon Emitted:** [More Information Needed]
|
157 |
-
|
158 |
-
## Technical Specifications [optional]
|
159 |
-
|
160 |
-
### Model Architecture and Objective
|
161 |
-
|
162 |
-
[More Information Needed]
|
163 |
-
|
164 |
-
### Compute Infrastructure
|
165 |
|
166 |
-
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
[More Information Needed]
|
171 |
-
|
172 |
-
#### Software
|
173 |
-
|
174 |
-
[More Information Needed]
|
175 |
-
|
176 |
-
## Citation [optional]
|
177 |
-
|
178 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
179 |
|
180 |
**BibTeX:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
**APA:**
|
185 |
-
|
186 |
-
[More Information Needed]
|
187 |
-
|
188 |
-
## Glossary [optional]
|
189 |
-
|
190 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
191 |
-
|
192 |
-
[More Information Needed]
|
193 |
-
|
194 |
-
## More Information [optional]
|
195 |
-
|
196 |
-
[More Information Needed]
|
197 |
-
|
198 |
-
## Model Card Authors [optional]
|
199 |
|
200 |
-
|
201 |
|
202 |
## Model Card Contact
|
203 |
|
204 |
-
|
|
|
6 |
- asr
|
7 |
- peft
|
8 |
- lora
|
9 |
+
license: apache-2.0
|
10 |
+
datasets:
|
11 |
+
- mozilla-foundation/common_voice_13_0
|
12 |
+
language:
|
13 |
+
- hi
|
14 |
+
metrics:
|
15 |
+
- wer
|
16 |
+
base_model:
|
17 |
+
- openai/whisper-small
|
18 |
+
pipeline_tag: automatic-speech-recognition
|
19 |
---
|
20 |
|
21 |
+
# Whisper Small - Hindi Automatic Speech Recognition Model
|
|
|
|
|
|
|
|
|
22 |
|
23 |
## Model Details
|
24 |
|
25 |
### Model Description
|
26 |
|
27 |
+
This is a fine-tuned Whisper Small model for Automatic Speech Recognition (ASR) in Hindi, developed using Parameter-Efficient Fine-Tuning (PEFT) with Low-Rank Adaptation (LoRA). The model is designed to transcribe Hindi speech with improved accuracy and efficiency.
|
|
|
|
|
28 |
|
29 |
+
- **Developed by:** martin-mwiti
|
30 |
+
- **Model type:** Automatic Speech Recognition (ASR)
|
31 |
+
- **Language(s):** Hindi
|
32 |
+
- **License:** Apache-2.0
|
33 |
+
- **Finetuned from model:** openai/whisper-small
|
|
|
|
|
34 |
|
35 |
+
### Model Sources
|
36 |
|
37 |
+
- **Repository:** [GitHub/martin-mwiti/AI-Model-Hub/ASR](https://github.com/MartinMwiti/AI-Model-Hub/ASR)
|
38 |
+
- **HuggingFace Hub:** [martin-mwiti/whisper-small-hi-lora-r32-alpha64-20241231](https://huggingface.co/martin-mwiti/whisper-small-hi-lora-r32-alpha64-20241231)
|
|
|
|
|
|
|
39 |
|
40 |
## Uses
|
41 |
|
|
|
|
|
42 |
### Direct Use
|
43 |
|
44 |
+
This model can be used for transcribing Hindi speech audio files. It is optimized for automatic speech recognition tasks using the Whisper Small model as a base.
|
|
|
|
|
45 |
|
46 |
+
### Downstream Use
|
47 |
|
48 |
+
The model can be further fine-tuned or used as a starting point for other Hindi speech recognition applications.
|
|
|
|
|
49 |
|
50 |
### Out-of-Scope Use
|
51 |
|
52 |
+
- Do not use for languages other than Hindi
|
53 |
+
- Not suitable for real-time streaming audio transcription
|
54 |
+
- Avoid using in high-stakes or safety-critical applications without additional validation
|
55 |
|
56 |
## Bias, Risks, and Limitations
|
57 |
|
58 |
+
- Performance may vary depending on audio quality, accent, and background noise
|
59 |
+
- Trained on Common Voice dataset, which may not represent all Hindi dialects and speaking styles
|
60 |
+
- May have biases present in the training data
|
61 |
|
62 |
### Recommendations
|
63 |
|
64 |
+
- Validate model performance on your specific use case
|
65 |
+
- Use in conjunction with human review for critical applications
|
66 |
+
- Be aware of potential cultural or linguistic biases
|
67 |
|
68 |
## How to Get Started with the Model
|
69 |
|
70 |
+
```python
|
71 |
+
from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
72 |
+
from peft import PeftModel, PeftConfig
|
73 |
|
74 |
+
# Load the processor from the base model
|
75 |
+
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
|
76 |
|
77 |
+
# Load the base Whisper model
|
78 |
+
base_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
|
79 |
|
80 |
+
# Load the adapter configuration and model
|
81 |
+
adapter_config = PeftConfig.from_pretrained("martin-mwiti/whisper-small-hi-lora-r32-alpha64-20241231")
|
82 |
+
model = PeftModel.from_pretrained(base_model, adapter_config)
|
83 |
|
84 |
+
# Use the model for inference
|
85 |
+
audio_array = ... # Replace with your audio array
|
86 |
+
inputs = processor(audio_array, sampling_rate=16000, return_tensors="pt")
|
87 |
+
predicted_ids = model.generate(inputs.input_features)
|
88 |
|
89 |
+
# Decode the transcription
|
90 |
+
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
|
91 |
|
92 |
+
print("Transcription:", transcription)
|
93 |
|
94 |
+
```
|
|
|
|
|
|
|
|
|
95 |
|
96 |
+
## Training Details
|
97 |
|
98 |
+
### Training Data
|
99 |
|
100 |
+
- **Dataset:** Common Voice 13.0
|
101 |
+
- **Language:** Hindi
|
102 |
+
- **Splits:** Trained on combined train and validation sets, tested on test set
|
103 |
|
104 |
+
### Training Procedure
|
105 |
|
106 |
+
#### Training Hyperparameters
|
107 |
|
108 |
+
- **Base Model:** openai/whisper-small
|
109 |
+
- **Fine-Tuning Method:** PEFT with LoRA
|
110 |
+
- **LoRA Configuration:**
|
111 |
+
- Rank (r): 32
|
112 |
+
- Alpha: 64
|
113 |
+
- Target Modules: query and value projection matrices
|
114 |
+
- Dropout: 5%
|
115 |
+
- **Training Regime:** Mixed precision (fp16)
|
116 |
+
- **Batch Size:** 8 per device
|
117 |
+
- **Learning Rate:** 1e-3
|
118 |
+
- **Warmup Steps:** 25
|
119 |
+
- **Total Training Steps:** 50
|
120 |
|
121 |
## Evaluation
|
122 |
|
123 |
+
### Metrics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
- **Primary Metric:** Word Error Rate (WER)
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
### Results
|
128 |
|
129 |
+
| Metric | Value |
|
130 |
+
|---------------|---------|
|
131 |
+
| **Average WER** | 0.6938 |
|
132 |
+
| **Best WER** | 0.0000 |
|
133 |
+
| **Worst WER** | 1.6000 |
|
|
|
|
|
134 |
|
135 |
+
- **Evaluation Dataset:** Common Voice 13.0 Hindi Test Set
|
136 |
+
- **Number of Evaluation Samples:** 50
|
|
|
137 |
|
138 |
## Environmental Impact
|
139 |
|
140 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
+
## Citation
|
143 |
|
144 |
+
If you use this model, please cite the original Whisper paper and acknowledge the fine-tuning work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
**BibTeX:**
|
147 |
+
```bibtex
|
148 |
+
@misc{whisper2022,
|
149 |
+
title={Robust Speech Recognition via Large-Scale Weak Supervision},
|
150 |
+
author={Radford, Alec and Kim, Jong Wook and Xu, Tao and et al.},
|
151 |
+
publisher={arXiv},
|
152 |
+
year={2022}
|
153 |
+
}
|
154 |
+
```
|
155 |
|
156 |
+
## Model Card Authors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
+
- martin-mwiti
|
159 |
|
160 |
## Model Card Contact
|
161 |
|
162 |
+
For questions or feedback, please open an issue on the GitHub repository or contact the model author.
|