Model reference · open weights
wav2vec2-large-ru-golos-with-lm is an open-weight audio or speech model from bond005. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | bond005 |
|---|---|
| Type | Audio & music |
| Task | Speech→text |
| Runs with | transformers |
| Released | 2022-09-26 |
| Popularity | 11k downloads / month |
| Licence | Open weights |
About
The Wav2Vec2 model is based on facebook/wav2vec2-large-xlsr-53, fine-tuned in Russian using Sberdevices Golos with audio augmentations like as pitch shift, acceleration/deceleration of sound, reverberation etc.
The 2-gram language model is built on the Russian text corpus obtained from three open sources:
When using this model, make sure that your speech input is sampled at 16kHz.
You can use this model by writing your own inference script:
import os
import warnings
import librosa
import nltk
import numpy as np
import torch
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2ProcessorWithLM
MODEL_ID = "bond005/wav2vec2-large-ru-golos-with-lm"
DATASET_ID = "bond005/sberdevices_golos_10h_crowd"
SAMPLES = 30
nltk.download('punkt')
num_processes = max(1, os.cpu_count())
test_dataset = load_dataset(DATASET_ID, split=f"test[:{SAMPLES}]")
processor = Wav2Vec2ProcessorWithLM.from_pretrained(MODEL_ID)
model = Wav2Vec2ForCTC.from_pretrained(MODEL_ID)
# Preprocessing the datasets.
# We need to read the audio files as arrays
def speech_file_to_array_fn(batch):
speech_array = batch["audio"]["array"]
batch["speech"] = np.asarray(speech_array, dtype=np.float32)
return batch
removed_columns = set(test_dataset.column_names)
removed_columns -= {'transcription', 'speech'}
removed_columns = sorted(list(removed_columns))
with warnings.catch_warnings():
warnings.simplefilter("ignore")
test_dataset = test_dataset.map(
speech_file_to_array_fn,
num_proc=num_processes,
remove_columns=removed_columns
)
inputs = processor(test_dataset["speech"], sampling_rate=16_000,
return_tensors="pt", padding=True)
with torch.no_grad():
logits = model(inputs.input_values,
attention_mask=inputs.attention_mask).logits
predicted_sentences = processor.batch_decode(
logits=logits.numpy(),
num_processes=num_processes
).text
with warnings.catch_warnings():
warnings.simplefilter("ignore")
for i, predicted_sentence in enumerate(predicted_sentences):
print("-" * 100)
print("Reference:", test_dataset[i]["transcription"])
print("Prediction:", predicted_sentence)
----------------------------------------------------------------------------------------------------
Reference: шестьдесят тысяч тенге сколько будет стоить
Prediction: шестьдесят тысяч тенге сколько будет стоить
----------------------------------------------------------------------------------------------------
Reference: покажи мне на смотрешке телеканал синергия тв
Prediction: покажи мне на смотрешке телеканал синергия тв
----------------------------------------------------------------------------------------------------
Reference: заказать яблоки зеленые
Prediction: заказать яблоки зеленые
----------------------------------------------------------------------------------------------------
Reference: алиса закажи килограммовый торт графские развалины
Prediction: алиса закажи килограммовый торт графские развалины
----------------------------------------------------------------------------------------------------
Reference: ищи телеканал про бизнес на тиви
Prediction: ищи телеканал про бизнес на тиви
----------------------------------------------------------------------------------------------------
Reference: михаила мурадяна
Prediction: михаила мурадяна
----------------------------------------------------------------------------------------------------
Reference: любовницы две тысячи тринадцать пятнадцатый сезон
Prediction: любовница две тысячи тринадцать пятнадцатый сезон
----------------------------------------------------------------------------------------------------
Reference: найди боевики
Prediction: найди боевики
----------------------------------------------------------------------------------------------------
Reference: гетто сезон три
Prediction: гета сезон три
----------------------------------------------------------------------------------------------------
Reference: хочу посмотреть ростов папа на телевизоре
Prediction: хочу посмотреть ростоу папа на телевизоре
----------------------------------------------------------------------------------------------------
Reference: сбер какое твое самое ненавистное занятие
Prediction: сбер какое твое самое ненавистное занятие
----------------------------------------------------------------------------------------------------
Reference: афина чем платят у китайцев
Prediction: афина чем платят у китайцев
----------------------------------------------------------------------------------------------------
Reference: джой как работает досрочное погашение кредита
Prediction: джой как работает досрочное погашение кредита
----------------------------------------------------------------------------------------------------
Reference: у тебя найдется люк кейдж
Prediction: у тебя найдется люк кейдж
----------------------------------------------------------------------------------------------------
Reference: у тебя будет лучшая часть пинк
Prediction: у тебя будет лучшая часть пинк
----------------------------------------------------------------------------------------------------
Reference: пожалуйста пополните мне счет
Prediction: пожалуйста пополните мне счет
----------------------------------------------------------------------------------------------------
Reference: анне павловне шабуровой
Prediction: анне павловне шабуровой
----------------------------------------------------------------------------------------------------
Reference: врубай на смотрешке муз тв
Prediction: врубай на смотрешке муз From the published model card. Full card on the HuggingFace links in the sidebar.
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Speech Recognition | Sberdevices Golos (crowd) | Test WER | 6.883 |
| Speech Recognition | Sberdevices Golos (crowd) | Test CER | 1.637 |
| Speech Recognition | Sberdevices Golos (farfield) | Test WER | 15.044 |
| Speech Recognition | Sberdevices Golos (farfield) | Test CER | 5.128 |
| Automatic Speech Recognition | Common Voice ru | Test WER | 12.115 |
| Automatic Speech Recognition | Common Voice ru | Test CER | 2.980 |
| Automatic Speech Recognition | Russian Librispeech | Test WER | 15.736 |
| Automatic Speech Recognition | Russian Librispeech | Test CER | 3.573 |
| Automatic Speech Recognition | Sova RuDevices | Test WER | 20.652 |
| Automatic Speech Recognition | Sova RuDevices | Test CER | 7.287 |
| Automatic Speech Recognition | Voxforge Ru | Test WER | 19.079 |
| Automatic Speech Recognition | Voxforge Ru | Test CER | 5.864 |
Using it via the API
Once AxForge deploys wav2vec2-large-ru-golos-with-lm for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (wav2vec2-large-ru-golos-with-lm below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/audio/transcriptions \ -H "Authorization: Bearer $AXFORGE_API_KEY" \ -F model="wav2vec2-large-ru-golos-with-lm" -F file=@audio.mp3
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.