Update README.md
Browse files
README.md
CHANGED
|
@@ -4,4 +4,61 @@ datasets:
|
|
| 4 |
metrics:
|
| 5 |
- wer
|
| 6 |
pipeline_tag: automatic-speech-recognition
|
| 7 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
metrics:
|
| 5 |
- wer
|
| 6 |
pipeline_tag: automatic-speech-recognition
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Wav2vec2-Bert-Fongbe
|
| 10 |
+
|
| 11 |
+
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 language.
|
| 12 |
+
|
| 13 |
+
## Model description
|
| 14 |
+
This model is a fine-tuned version of the wav2vec2-BERT architecture on the AlorésB dataset for the Fongbe language. Fongbe, a Gbe language, is predominantly spoken in the southern region of Benin. The model has been fine-tuned specifically for Automatic Speech Recognition (ASR) tasks in this language.
|
| 15 |
+
It can be useful for transcription services, research, and linguistic studies involving Fongbe.
|
| 16 |
+
|
| 17 |
+
### Details
|
| 18 |
+
|
| 19 |
+
* Model Name: wav2vec2-bert-fongbe
|
| 20 |
+
* Base Model: facebook/w2v-bert-2.0
|
| 21 |
+
* Fine-tuned on: Aloresb dataset
|
| 22 |
+
* Languages: Fongbe
|
| 23 |
+
* Architecture: Wav2vec2 + BERT
|
| 24 |
+
* Fine-tuning Dataset: Aloresb (Fongbe)
|
| 25 |
+
|
| 26 |
+
### How to use
|
| 27 |
+
|
| 28 |
+
```
|
| 29 |
+
import torch
|
| 30 |
+
import soundfile as sf
|
| 31 |
+
from transformers import AutoModelForCTC, Wav2Vec2BertProcessor
|
| 32 |
+
|
| 33 |
+
model_name = "OctaSpace/wav2vec2-bert-fongbe"
|
| 34 |
+
|
| 35 |
+
asr_model = AutoModelForCTC.from_pretrained(model_name).to(device)
|
| 36 |
+
processor = Wav2Vec2BertProcessor.from_pretrained(model_name)
|
| 37 |
+
|
| 38 |
+
audio_input, _ = sf.read(file)
|
| 39 |
+
|
| 40 |
+
inputs = processor([audio_input], sampling_rate=16_000).input_features
|
| 41 |
+
features = torch.tensor(inputs)
|
| 42 |
+
|
| 43 |
+
with torch.no_grad():
|
| 44 |
+
logits = asr_model(features).logits
|
| 45 |
+
|
| 46 |
+
predicted_ids = torch.argmax(logits, dim=-1)
|
| 47 |
+
predictions = processor.batch_decode(predicted_ids, skip_special_tokens=True)
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
### Training Procedure
|
| 52 |
+
|
| 53 |
+
The model was fine-tuned on the Aloresb dataset, which contains audio recordings and transcriptions in Fongbe.
|
| 54 |
+
|
| 55 |
+
### Training Parameters:
|
| 56 |
+
|
| 57 |
+
Optimizer: AdamW
|
| 58 |
+
Learning Rate: 3e-5
|
| 59 |
+
Batch Size: 3
|
| 60 |
+
Epochs: 3
|
| 61 |
+
Evaluation Results
|
| 62 |
+
The model was evaluated using the Word Error Rate (WER) metric on a test set. Here are the results:
|
| 63 |
+
|
| 64 |
+
WER: 24.20%
|