milanakdj commited on
Commit
32b2276
·
verified ·
1 Parent(s): 511e4e8

Add comprehensive model card

Browse files
Files changed (1) hide show
  1. README.md +314 -131
README.md CHANGED
@@ -1,199 +1,382 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
 
 
 
 
 
 
11
 
12
- ## Model Details
13
 
14
- ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
 
76
  ## Training Details
77
 
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
 
88
- #### Preprocessing [optional]
 
 
89
 
90
- [More Information Needed]
91
 
 
92
 
93
- #### Training Hyperparameters
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
 
97
- #### Speeds, Sizes, Times [optional]
 
 
 
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
 
103
- ## Evaluation
 
 
 
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
 
107
- ### Testing Data, Factors & Metrics
108
 
109
- #### Testing Data
 
 
 
110
 
111
- <!-- This should link to a Dataset Card if possible. -->
 
 
 
 
 
112
 
113
- [More Information Needed]
 
 
 
114
 
115
- #### Factors
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
- [More Information Needed]
120
 
121
- #### Metrics
 
 
 
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
 
 
124
 
125
- [More Information Needed]
 
126
 
127
- ### Results
 
128
 
129
- [More Information Needed]
 
 
130
 
131
- #### Summary
132
 
 
133
 
 
 
 
 
 
 
 
 
134
 
135
- ## Model Examination [optional]
136
 
137
- <!-- Relevant interpretability work for the model goes here -->
 
 
 
138
 
139
- [More Information Needed]
140
 
141
- ## Environmental Impact
142
 
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
 
 
 
 
144
 
145
- 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).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
 
153
- ## Technical Specifications [optional]
 
 
154
 
155
- ### Model Architecture and Objective
156
 
157
- [More Information Needed]
 
 
158
 
159
- ### Compute Infrastructure
160
 
161
- [More Information Needed]
162
 
163
- #### Hardware
 
 
 
 
 
 
 
 
 
164
 
165
- [More Information Needed]
166
 
167
- #### Software
 
 
 
 
 
 
 
168
 
169
- [More Information Needed]
170
 
171
- ## Citation [optional]
 
 
 
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
- **BibTeX:**
176
 
177
- [More Information Needed]
178
 
179
- **APA:**
180
 
181
- [More Information Needed]
182
 
183
- ## Glossary [optional]
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
 
187
- [More Information Needed]
 
 
 
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
 
 
192
 
193
- ## Model Card Authors [optional]
194
 
195
- [More Information Needed]
196
 
197
- ## Model Card Contact
198
 
199
- [More Information Needed]
 
 
 
1
  ---
2
+ language:
3
+ - bo # Tibetan ISO 639-1 code
4
+ tags:
5
+ - whisper
6
+ - audio
7
+ - automatic-speech-recognition
8
+ - speech-to-text
9
+ - tibetan
10
+ - translation
11
+ - low-resource
12
+ license: apache-2.0
13
+ base_model: openai/whisper-small
14
+ datasets:
15
+ - lilgoose777/merged-tibetan-titung-goose
16
  library_name: transformers
17
+ pipeline_tag: automatic-speech-recognition
18
+ metrics:
19
+ - wer
20
+ model-index:
21
+ - name: Whisper Small Tibetan
22
+ results:
23
+ - task:
24
+ type: automatic-speech-recognition
25
+ name: Automatic Speech Recognition
26
+ dataset:
27
+ type: lilgoose777/merged-tibetan-titung-goose
28
+ name: Merged Tibetan Titung Goose
29
+ metrics:
30
+ - type: wer
31
+ value: XX.XX
32
+ name: Word Error Rate
33
  ---
34
 
35
+ # Whisper Small - Tibetan Speech Translation
36
 
37
+ This model is a fine-tuned version of **[openai/whisper-small](https://huggingface.co/openai/whisper-small)** for Tibetan speech-to-text translation.
38
 
39
+ ## Model Description
40
 
41
+ - **Model**: Whisper Small (244M parameters)
42
+ - **Language**: Tibetan (བོད་སྐད།)
43
+ - **Task**: Speech Translation (Tibetan audio → Text transcription)
44
+ - **Base Model**: openai/whisper-small
45
+ - **Dataset**: [lilgoose777/merged-tibetan-titung-goose](https://huggingface.co/datasets/lilgoose777/merged-tibetan-titung-goose)
46
+ - **Checkpoint**: checkpoint-3000
47
 
48
+ ## Intended Uses
49
 
50
+ This model is designed to transcribe Tibetan speech into written text. It can be used for:
51
 
52
+ - 📝 Transcribing Tibetan audio recordings
53
+ - 🎙️ Building Tibetan speech recognition applications
54
+ - 📚 Creating subtitles for Tibetan audio/video content
55
+ - 🔬 Research in low-resource language ASR
56
+ - 📖 Preserving and digitizing Tibetan oral traditions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  ## Training Details
59
 
60
+ ### Dataset
 
 
 
 
 
 
61
 
62
+ The model was trained on the **Merged Tibetan Titung Goose** dataset, which combines multiple Tibetan audio sources for improved coverage.
63
 
64
+ - **Dataset**: `lilgoose777/merged-tibetan-titung-goose`
65
+ - **Train/Test Split**: 90/10
66
+ - **Sampling Rate**: 16000 Hz
67
 
68
+ ### Training Hyperparameters
69
 
70
+ The model was fine-tuned with the following configuration:
71
 
72
+ | Hyperparameter | Value |
73
+ |----------------|-------|
74
+ | Base Model | `openai/whisper-small` |
75
+ | Training Steps | 3,000 |
76
+ | Batch Size (Train) | 16 |
77
+ | Batch Size (Eval) | 8 |
78
+ | Learning Rate | 1.25e-05 |
79
+ | Warmup Steps | 300 |
80
+ | Gradient Accumulation | 1 |
81
+ | Gradient Checkpointing | True |
82
+ | Mixed Precision (FP16) | False |
83
+ | Max Generation Length | 225 |
84
+ | Evaluation Strategy | Every 100 steps |
85
+ | Save Strategy | Every 100 steps |
86
 
87
+ ### Training Infrastructure
88
 
89
+ - **Framework**: HuggingFace Transformers 4.56.2
90
+ - **Training Framework**: Seq2SeqTrainer
91
+ - **Optimizer**: AdamW
92
+ - **Metric**: Word Error Rate (WER)
93
 
94
+ ### Results
 
 
95
 
96
+ | Metric | Value |
97
+ |--------|-------|
98
+ | **Best WER** | **XX.XX%** |
99
+ | Final WER | XX.XX% |
100
 
101
+ *Lower WER is better. WER (Word Error Rate) measures the percentage of words that are incorrectly transcribed.*
102
 
103
+ ## Usage
104
 
105
+ ### Quick Start with Pipeline
106
+
107
+ ```python
108
+ from transformers import pipeline
109
 
110
+ # Create transcription pipeline
111
+ pipe = pipeline(
112
+ "automatic-speech-recognition",
113
+ model="milanakdj/whisper-small-full-tibetan",
114
+ generate_kwargs={"language": "tibetan", "task": "translate"}
115
+ )
116
 
117
+ # Transcribe audio file
118
+ result = pipe("path/to/tibetan_audio.wav")
119
+ print(result["text"])
120
+ ```
121
 
122
+ ### Using Processor and Model
123
+
124
+ ```python
125
+ from transformers import WhisperProcessor, WhisperForConditionalGeneration
126
+ import torch
127
+
128
+ # Load model and processor
129
+ processor = WhisperProcessor.from_pretrained("milanakdj/whisper-small-full-tibetan")
130
+ model = WhisperForConditionalGeneration.from_pretrained("milanakdj/whisper-small-full-tibetan")
131
+
132
+ # Load your audio (16kHz sampling rate)
133
+ # audio_array = ... your audio array ...
134
+
135
+ # Process audio
136
+ input_features = processor(
137
+ audio_array,
138
+ sampling_rate=16000,
139
+ return_tensors="pt"
140
+ ).input_features
141
+
142
+ # Generate transcription
143
+ forced_decoder_ids = processor.get_decoder_prompt_ids(
144
+ language="tibetan",
145
+ task="translate"
146
+ )
147
+
148
+ with torch.no_grad():
149
+ predicted_ids = model.generate(
150
+ input_features,
151
+ forced_decoder_ids=forced_decoder_ids
152
+ )
153
+
154
+ # Decode
155
+ transcription = processor.batch_decode(
156
+ predicted_ids,
157
+ skip_special_tokens=True
158
+ )[0]
159
+
160
+ print(transcription)
161
+ ```
162
+
163
+ ### Using with Librosa
164
+
165
+ ```python
166
+ import librosa
167
+ from transformers import WhisperProcessor, WhisperForConditionalGeneration
168
+
169
+ # Load model
170
+ processor = WhisperProcessor.from_pretrained("milanakdj/whisper-small-full-tibetan")
171
+ model = WhisperForConditionalGeneration.from_pretrained("milanakdj/whisper-small-full-tibetan")
172
+
173
+ # Load audio file (automatically resamples to 16kHz)
174
+ audio, sr = librosa.load("tibetan_audio.mp3", sr=16000)
175
+
176
+ # Process and transcribe
177
+ input_features = processor(
178
+ audio,
179
+ sampling_rate=16000,
180
+ return_tensors="pt"
181
+ ).input_features
182
+
183
+ forced_decoder_ids = processor.get_decoder_prompt_ids(
184
+ language="tibetan",
185
+ task="translate"
186
+ )
187
+
188
+ predicted_ids = model.generate(
189
+ input_features,
190
+ forced_decoder_ids=forced_decoder_ids
191
+ )
192
+
193
+ transcription = processor.batch_decode(
194
+ predicted_ids,
195
+ skip_special_tokens=True
196
+ )[0]
197
+
198
+ print(transcription)
199
+ ```
200
+
201
+ ### Batch Processing Multiple Files
202
+
203
+ ```python
204
+ import torch
205
+ import librosa
206
+ from transformers import WhisperProcessor, WhisperForConditionalGeneration
207
+
208
+ # Load model
209
+ processor = WhisperProcessor.from_pretrained("milanakdj/whisper-small-full-tibetan")
210
+ model = WhisperForConditionalGeneration.from_pretrained("milanakdj/whisper-small-full-tibetan")
211
+
212
+ # Set device
213
+ device = "cuda" if torch.cuda.is_available() else "cpu"
214
+ model.to(device)
215
+
216
+ # Process multiple files
217
+ audio_files = ["file1.wav", "file2.wav", "file3.wav"]
218
+
219
+ for audio_file in audio_files:
220
+ # Load audio
221
+ audio, _ = librosa.load(audio_file, sr=16000)
222
+
223
+ # Process
224
+ input_features = processor(
225
+ audio,
226
+ sampling_rate=16000,
227
+ return_tensors="pt"
228
+ ).input_features.to(device)
229
+
230
+ # Generate
231
+ forced_decoder_ids = processor.get_decoder_prompt_ids(
232
+ language="tibetan",
233
+ task="translate"
234
+ )
235
+
236
+ with torch.no_grad():
237
+ predicted_ids = model.generate(
238
+ input_features,
239
+ forced_decoder_ids=forced_decoder_ids
240
+ )
241
+
242
+ # Decode
243
+ transcription = processor.batch_decode(
244
+ predicted_ids,
245
+ skip_special_tokens=True
246
+ )[0]
247
+
248
+ print(f"{audio_file}: {transcription}")
249
+ ```
250
 
251
+ ## Evaluation
252
 
253
+ To evaluate the model on your own Tibetan audio dataset:
254
 
255
+ ```python
256
+ from transformers import WhisperProcessor, WhisperForConditionalGeneration
257
+ from datasets import load_dataset
258
+ import evaluate
259
 
260
+ # Load model
261
+ processor = WhisperProcessor.from_pretrained("milanakdj/whisper-small-full-tibetan")
262
+ model = WhisperForConditionalGeneration.from_pretrained("milanakdj/whisper-small-full-tibetan")
263
 
264
+ # Load your dataset
265
+ dataset = load_dataset("your_tibetan_dataset")
266
 
267
+ # Initialize WER metric
268
+ wer_metric = evaluate.load("wer")
269
 
270
+ # Process and evaluate
271
+ # ... (see full evaluation code in documentation)
272
+ ```
273
 
274
+ ## Limitations and Considerations
275
 
276
+ ### Known Limitations
277
 
278
+ 1. **Domain Specificity**: The model is trained on specific Tibetan dialects and domains present in the training data
279
+ 2. **Audio Quality**: Performance degrades with:
280
+ - Background noise
281
+ - Poor recording quality
282
+ - Multiple speakers
283
+ - Non-standard dialects
284
+ 3. **Low-Resource Language**: As Tibetan is a low-resource language, the model may have limited generalization compared to high-resource language models
285
+ 4. **Code-Switching**: May struggle with Tibetan-English or Tibetan-Chinese code-switching
286
 
287
+ ### Best Practices
288
 
289
+ - **Audio Format**: Use 16kHz mono audio for best results
290
+ - **Clean Audio**: Minimize background noise and ensure clear speech
291
+ - **Standard Dialect**: Model performs best on dialects similar to training data
292
+ - **Audio Length**: Optimal performance on audio clips under 30 seconds
293
 
294
+ ## Ethical Considerations
295
 
296
+ ### Intended Use
297
 
298
+ This model is intended for:
299
+ - ✅ Transcription of Tibetan speech
300
+ - ✅ Educational purposes
301
+ - ✅ Research in speech recognition
302
+ - ✅ Preservation of Tibetan language
303
 
304
+ ### Out-of-Scope Use
 
 
 
 
 
 
305
 
306
+ - Surveillance or monitoring without consent
307
+ - ❌ Generating misleading transcriptions
308
+ - ❌ Any use that violates privacy or human rights
309
 
310
+ ### Bias and Fairness
311
 
312
+ - The model's performance may vary across different Tibetan dialects
313
+ - Training data may not represent all Tibetan-speaking communities equally
314
+ - Users should evaluate the model on their specific use case before deployment
315
 
316
+ ## Citation
317
 
318
+ If you use this model in your research or application, please cite:
319
 
320
+ ```bibtex
321
+ @misc{whisper-small-tibetan-2024,
322
+ author = {Milan Akdj},
323
+ title = {Whisper Small - Tibetan Speech Translation},
324
+ year = {2024},
325
+ publisher = {HuggingFace},
326
+ journal = {HuggingFace Model Hub},
327
+ howpublished = {\url{https://huggingface.co/milanakdj/whisper-small-full-tibetan}}
328
+ }
329
+ ```
330
 
331
+ Also cite the original Whisper paper:
332
 
333
+ ```bibtex
334
+ @article{radford2022whisper,
335
+ title={Robust Speech Recognition via Large-Scale Weak Supervision},
336
+ author={Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
337
+ journal={arXiv preprint arXiv:2212.04356},
338
+ year={2022}
339
+ }
340
+ ```
341
 
342
+ ## Acknowledgements
343
 
344
+ - **Base Model**: [OpenAI Whisper Small](openai/whisper-small)
345
+ - **Dataset**: [Merged Tibetan Titung Goose](lilgoose777/merged-tibetan-titung-goose)
346
+ - **Framework**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
347
+ - **Training**: Fine-tuned using HuggingFace Seq2SeqTrainer
348
 
349
+ ## Model Card Authors
350
 
351
+ Milan Akdj
352
 
353
+ ## Contact
354
 
355
+ For questions or issues with this model, please open an issue on the [model repository](https://huggingface.co/milanakdj/whisper-small-full-tibetan).
356
 
357
+ ---
358
 
359
+ ## Additional Information
360
 
361
+ ### Model Architecture
362
 
363
+ Whisper Small uses a Transformer encoder-decoder architecture:
364
+ - **Encoder**: Processes audio features
365
+ - **Decoder**: Generates text transcription
366
+ - **Parameters**: ~244M total parameters
367
 
368
+ ### Training Environment
369
 
370
+ - **Platform**: RunPod GPU Instance
371
+ - **Monitoring**: TensorBoard logging enabled
372
+ - **Evaluation**: WER metric on held-out test set
373
 
374
+ ### Version History
375
 
376
+ - **v1.0**: Initial release with checkpoint-3000
377
 
378
+ ---
379
 
380
+ **Language**: Tibetan (བོད་སྐད།)
381
+ **License**: Apache 2.0
382
+ **Model Size**: ~244M parameters