Downloads · 30 days
5
13% of all-time downloads
sajjadiba/urdu-asr-error-correction-tiny-aya-fire
urdu-asr-error-correction-tiny-aya-fire is a text generation model from sajjadiba. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-4.0.
This repository contains fine-tuned LoRA adapter weights for post-ASR error correction and sentence segmentation of Urdu transcripts generated by openai/whisper-large-v3-turbo.
Downloads · 30 days
5
13% of all-time downloads
All-time downloads
40
Public
Repo size
52.1 MB
Likes
2
Public
Click a slice to open those files.
.safetensors30.7 MB · 59%
From the Hugging Face model README
This repository contains fine-tuned LoRA adapter weights for post-ASR error correction and sentence segmentation of Urdu transcripts generated by openai/whisper-large-v3-turbo.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model_id = "CohereLabs/tiny-aya-fire"
adapter_id = "your-username/urdu-asr-error-correction-tiny-aya-fire"
# Load Base Model & Tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load Fine-Tuned Adapter
model = PeftModel.from_pretrained(base_model, adapter_id)
# Zero-Shot Prompt format as defined in the paper
ZERO_SHOT_PROMPT = """Task: Correct Urdu ASR errors.
Rules:
1. Fix ONLY spelling and character errors.
2. Keep correct words EXACTLY as is --- DO NOT rewrite or paraphrase.
3. DO NOT add any notes, explanations, or markers.
4. STOP immediately after the corrected sentence.
Input: {input_text}
Corrected:"""
# Example Raw ASR Output from Whisper
raw_asr_input = "آپ کا ان پٹ اردو جملہ یہاں درج کریں"
prompt = ZERO_SHOT_PROMPT.format(input_text=raw_asr_input)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
If you use this model adapter in your research, please cite our paper:
@inproceedings{haider2026improving,
title={Improving Urdu ASR with Fine-Tuned Small Language Models for Post-ASR Error Correction},
author={Haider, Sajjad and Shaikh, Solat Jabeen and Aqib, Zuha and Inayat, Farah and Ahmed, Zehra},
booktitle={Proceedings of the 2nd Workshop on Speech and Audio Language Models (SALMA @ EMNLP 2026)},
year={2026}
organization={Artificial Intelligence Lab, Department of Computer Science, Institute of Business Administration (IBA), Karachi, Pakistan}
}