transformers tensorboard safetensors whisper audio-classification generated_from_trainer uz en ru dataset:mozilla-foundation/common_voice_16_1 base_model:openai/whisper-small license:apache-2.0 endpoints_compatible region:us
---
license: apache-2.0
base_model: openai/whisper-small
tags:
- generated_from_trainer
metrics:
- accuracy
- f1
model-index:
- name: whisper-small-uz-en-ru-lang-id
  results: []
datasets:
- mozilla-foundation/common_voice_16_1
language:
- uz
- en
- ru
pipeline_tag: audio-classification
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# whisper-small-uz-en-ru-lang-id

This model is a fine-tuned version of [openai/whisper-small](https://huggingface.co/openai/whisper-small) on the "mozilla-foundation/common_voice_16_1"(uz/en/ru) dataset.
It achieves the following results on the validation set during training:
- Loss: 0.2065
- Accuracy: 0.9747
- F1: 0.9746

Accuracy on the test (evaluation) dataset: 92.4%.

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data
```python
# datasets for each language from the set {uz: Uzbek, en: English, ru: Russian}
common_voice_train_uz = load_dataset("mozilla-foundation/common_voice_16_1", "uz", split='train', trust_remote_code=True, token=env('HUGGING_TOKEN'), streaming=True)
common_voice_train_ru = load_dataset("mozilla-foundation/common_voice_16_1", "ru", split='train', trust_remote_code=True, token=env('HUGGING_TOKEN'), streaming=True)
common_voice_train_en = load_dataset("mozilla-foundation/common_voice_16_1", "en", split='train', trust_remote_code=True, token=env('HUGGING_TOKEN'), streaming=True)
common_voice_valid_uz = load_dataset("mozilla-foundation/common_voice_16_1", "uz", split='validation', trust_remote_code=True, token=env('HUGGING_TOKEN'), streaming=True)
common_voice_valid_ru = load_dataset("mozilla-foundation/common_voice_16_1", "ru", split='validation', trust_remote_code=True, token=env('HUGGING_TOKEN'), streaming=True)
common_voice_valid_en = load_dataset("mozilla-foundation/common_voice_16_1", "en", split='validation', trust_remote_code=True, token=env('HUGGING_TOKEN'), streaming=True)

# code to shuffle and to take limited size of data. Rows per set: Train-24000, Validation-3000.
... 
# concatenate 3 datasets
common_voice['train'] = concatenate_datasets([common_voice_train_uz, common_voice_train_ru, common_voice_train_en])
```
## Training procedure

Used Trainer from transformers.
Training and evaluation process are described in the Jupyter notebook, storing in the following github repository:

https://github.com/fitlemon/whisper-small-uz-en-ru-lang-id


### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 3e-05
- train_batch_size: 2
- eval_batch_size: 2
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 8
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- training_steps: 9000
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1     |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|
| 0.0252        | 1  | 3000 | 0.3089          | 0.953    | 0.9525 |
| 0.0357        | 2  | 6000 | 0.1732          | 0.964    | 0.9637 |
| 0.0           | 3  | 9000 | 0.2065          | 0.9747   | 0.9746 |


### Framework versions

- Transformers 4.38.2
- Pytorch 2.2.1+cu121
- Datasets 2.17.1
- Tokenizers 0.15.2