Create README.md
Browse files# Wav2vec2-Bert-Fongbe
This model is a fine-tuned version of [facebook/w2v-bert-2.0](https://arxiv.org/abs/2108.06209). This has a WER of 24.20 on [Aloresb dataset](https://huggingface.co/datasets/alaleye/aloresb) (fongbe).
## Model description
The model is intended to aid in Automatic Speech Recognition tasks for Fongbe and similar Gbe languages. It can be useful for transcription services, research, and linguistic studies involving Fongbe.
## How to use
```
import torch
import soundfile as sf
from transformers import AutoModelForCTC, Wav2Vec2BertProcessor
model_name = "OctaSpace/wav2vec2-bert-fongbe"
asr_model = AutoModelForCTC.from_pretrained(model_name).to(device)
processor = Wav2Vec2BertProcessor.from_pretrained(model_name)
audio_input, _ = sf.read(file)
inputs = processor([audio_input], sampling_rate=16_000).input_features
features = torch.tensor(inputs)
with torch.no_grad():
logits = asr_model(features).logits
predicted_ids = torch.argmax(logits, dim=-1)
predictions = processor.batch_decode(predicted_ids, skip_special_tokens=True)
```
## Training Procedure
### Dataset
The model was fine-tuned on the aloresb dataset, which contains audio recordings and transcriptions in Fongbe.
### Training Parameters:
* Optimizer: AdamW
* Learning Rate: 3e-4
* Batch Size: 3
* Epochs: 3