Language Identification for Indian Languages from Speech
Model Overview
vakgyata is an open-source language identification model specifically designed to classify Indian languages from raw speech audio. It is built upon the pretrained Harveenchadha/wav2vec2-pretrained-clsril-23-10k with additional Layer Normalization integrated to improve stability and performance for audio classification tasks.
1import torchaudio
23# Load the audio (ensure it's 16kHz mono)4audio, sr = torchaudio.load("path/to/audio.wav")56# Preprocess7inputs = processor(audio.squeeze(), sampling_rate=sr, return_tensors="pt").to(device)89# Inference10with torch.no_grad():11 logits = model(**inputs).logits
1213# Softmax to get probabilities14probs = logits.softmax(dim=-1).cpu().numpy()1516# Predicted language17language = model.config.id2label.get(probs.argmax())18print("Predicted Language:", language)
Citation
If you use this model in your research or application, please consider citing the model and its base source:
@misc{vakgyata2024,
title={vakgyata: Language Identification for Indian Speech},
author={OneCXI},
year={2024},
url={https://huggingface.co/onecxi/vakgyata-tiny}
}