Audio Classification
Transformers
ONNX
Safetensors
PyTorch
wav2vec2
language-identification
indian-languages
multilingual
speech
asr-preprocessing
callcenter-ai
speech-analytics
huggingface
Instructions to use onecxi/vakgyata-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onecxi/vakgyata-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="onecxi/vakgyata-base")# Load model directly from transformers import AutoProcessor, AutoModelForAudioClassification processor = AutoProcessor.from_pretrained("onecxi/vakgyata-base") model = AutoModelForAudioClassification.from_pretrained("onecxi/vakgyata-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 3,056 Bytes
9bd306d 50bd214 9bd306d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | ---
language:
- en
- hi
- or
- bn
- ta
- te
- kn
- ml
- mr
- gu
- pa
- as
license: apache-2.0
pipeline_tag: audio-classification
library_name: transformers
tags:
- language-identification
- indian-languages
- multilingual
- speech
- asr-preprocessing
- callcenter-ai
- speech-analytics
- audio-classification
- wav2vec2
- transformers
- pytorch
- huggingface
---
# **Vakgyata**
**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`](https://huggingface.co/Harveenchadha/wav2vec2-pretrained-clsril-23-10k) with additional **Layer Normalization** integrated to improve stability and performance for audio classification tasks.
---
## **Variants and Model Sizes**
| Variant | Parameters | Accuracy |
| ---------------- | ---------- | -------- |
| `vakgyata-base` | 95M | 95.88% |
| `vakgyata-small` | 52M | 95.06% |
| `vakgyata-mini` | 38M | 95.06% |
| `vakgyata-tiny` | 24M | 93.63% |
---
## **Supported Languages**
| Language | Code |
| --------------- | ----- |
| English (India) | en-IN |
| Hindi | hi-IN |
| Odia | or-IN |
| Bengali | bn-IN |
| Tamil | ta-IN |
| Telugu | te-IN |
| Kannada | kn-IN |
| Malayalam | ml-IN |
| Marathi | mr-IN |
| Gujarati | gu-IN |
| Punjabi | pa-IN |
| Assamese | as-IN |
---
## **Specifications**
* **Supported Sampling Rate:** 16000 Hz
* **Recommended Audio Format:** 16kHz, 16bit PCM (Mono)
---
## **Installation**
```bash
pip install transformers torchaudio
```
---
## **Usage**
```python
from transformers import Wav2Vec2ForSequenceClassification, AutoFeatureExtractor
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
model_id = "onecxi/vakgyata-base" # You can replace with tiny/small/mini variants
processor = AutoFeatureExtractor.from_pretrained(model_id)
model = Wav2Vec2ForSequenceClassification.from_pretrained(model_id).to(device)
```
---
## **Inference Example**
```python
import torchaudio
# Load the audio (ensure it's 16kHz mono)
audio, sr = torchaudio.load("path/to/audio.wav")
# Preprocess
inputs = processor(audio.squeeze(), sampling_rate=sr, return_tensors="pt").to(device)
# Inference
with torch.no_grad():
logits = model(**inputs).logits
# Softmax to get probabilities
probs = logits.softmax(dim=-1).cpu().numpy()
# Predicted language
language = model.config.id2label.get(probs.argmax())
print("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-base}
}
```
--- |