๐ Wav2vec2 Large 100k Voxpopuli fine-tuned with Common Voice and M-AILABS in Russian
This project fine-tunes Wav2vec2 Large 100k Voxpopuli in Russian using the Common Voice 7.0 and M-AILABS, aiming to improve the performance of automatic speech recognition in the Russian language.
๐ Quick Start
Prerequisites
- The model is based on the
transformers
library, so make sure you have it installed.
- You also need
torchaudio
for audio processing.
Installation
You can install the required libraries using pip
:
pip install transformers torchaudio
โจ Features
- Fine-tuned for Russian: This model is fine-tuned on the Russian language using the Common Voice 7.0 and M-AILABS datasets, which can better adapt to Russian speech characteristics.
- High-performance Speech Recognition: It can achieve a relatively low Word Error Rate (WER) in Russian speech recognition tasks.
๐ฆ Installation
As mentioned above, you can install the necessary libraries via pip
:
pip install transformers torchaudio
๐ป Usage Examples
Basic Usage
from transformers import AutoTokenizer, Wav2Vec2ForCTC
tokenizer = AutoTokenizer.from_pretrained("Edresson/wav2vec2-large-100k-voxpopuli-ft-Common-Voice_plus_TTS-Dataset-russian")
model = Wav2Vec2ForCTC.from_pretrained("Edresson/wav2vec2-large-100k-voxpopuli-ft-Common-Voice_plus_TTS-Dataset-russian")
Advanced Usage
Example test with Common Voice Dataset
dataset = load_dataset("common_voice", "pt", split="test", data_dir="./cv-corpus-6.1-2020-12-11")
resampler = torchaudio.transforms.Resample(orig_freq=48_000, new_freq=16_000)
def map_to_array(batch):
speech, _ = torchaudio.load(batch["path"])
batch["speech"] = resampler.forward(speech.squeeze(0)).numpy()
batch["sampling_rate"] = resampler.new_freq
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower().replace("รขโฌโข", "'")
return batch
ds = dataset.map(map_to_array)
result = ds.map(map_to_pred, batched=True, batch_size=1, remove_columns=list(ds.features.keys()))
print(wer.compute(predictions=result["predicted"], references=result["target"]))
๐ Documentation
Model Information
Property |
Details |
Model Type |
Wav2vec2 Large 100k Voxpopuli fine-tuned with Common Voice and M-AILABS in Russian |
Training Data |
Common Voice 7.0 and M-AILABS |
Results
For the results check the paper
๐ License
This model is licensed under the apache-2.0
license.