Edit model card

Wav2Vec-Bert-2.0-ngram-Urdu

This model is a fine-tuned version of facebook/w2v-bert-2.0 on the Urdu split of the Common Voice 17 dataset. The fine-tuned model is enhanced with the addition of an ngram language model that has also been trained on the same dataset. It achieves the following results on the evaluation set:

  • Loss: 0.3681
  • Wer: 0.2407

Usage Instructions

from transformers import AutoFeatureExtractor, Wav2Vec2BertModel
import torch
from datasets import load_dataset

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = AutoProcessor.from_pretrained("UmarRamzan/w2v2-bert-ngram-urdu")
model = Wav2Vec2BertModel.from_pretrained("UmarRamzan/w2v2-bert-ngram-urdu")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-06
  • train_batch_size: 16
  • eval_batch_size: 8
  • seed: 42
  • gradient_accumulation_steps: 2
  • total_train_batch_size: 32
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_steps: 100
  • num_epochs: 1
  • mixed_precision_training: Native AMP

Framework versions

  • Transformers 4.40.2
  • Pytorch 2.2.1+cu121
  • Datasets 2.19.1
  • Tokenizers 0.19.1
Downloads last month
8
Safetensors
Model size
606M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for UmarRamzan/w2v2-bert-ngram-urdu

Unable to build the model tree, the base model loops to the model itself. Learn more.

Dataset used to train UmarRamzan/w2v2-bert-ngram-urdu

Collection including UmarRamzan/w2v2-bert-ngram-urdu