File size: 3,566 Bytes
96724c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7721787
 
96724c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-nc-4.0
language: ddn
metrics:
- wer
tags:
- text-to-audio
- automatic-speech-recognition
- wav2vec2-fine-tuning
- dendi-text-to-speech
model-index:
- name: Dendi Numerals ASR
  results:
  - task: 
      name: Speech Recognition
      type: automatic-speech-recognition
    dataset:
      name: dendi
      type: dendi_numbers_dataset
    metrics:
       - name: Test WER
         type: wer
         value: 18.18
pipeline_tag: automatic-speech-recognition
---

# CreaTiv Team (CTT): Dendi Numerals Automatic Speech Recognition

This repository contains an Automatic Speech Recognition (ASR) model specifically for recognizing numerals in the Dendi (ddn) language.
The model can accurately recognize numbers ranging from 0 to 1,000,000,000 when spoken in Dendi.

This model is part of Creativ Team's [Noulinmon](https://noulinmon.baruwuu.bj/) project, a user-friendly mobile app designed to make calculations accessible in six local languages of Benin, featuring voice reading and AI capabilities.
You can find more CTT-ASR models on the Hugging Face Hub: [ssid32/ctt-asr](https://huggingface.co/models?sort=trending&search=ssid32).

CTT-ASR is available in the 🤗 Transformers library from version 4.4 onwards.

## Model Details

The model is a fine-tuned version of [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) on Dendi.
When using this model, make sure that your speech input is sampled at 16kHz.


## Usage

To use this model, first install the latest version of 🤗 Transformers library:

```
pip install --upgrade transformers accelerate
```

Then, run inference with the following code-snippet:

```python
import torch
import torchaudio
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor

processor = Wav2Vec2Processor.from_pretrained("ssid32/wav2vec2-xlsr-dendi-ddn-for-numerals") 
model = Wav2Vec2ForCTC.from_pretrained("ssid32/wav2vec2-xlsr-dendi-ddn-for-numerals")

speech_array, sampling_rate = torchaudio.load("audio_test.wav")
speech_array = speech_array.squeeze().numpy()
inputs = processor(speech_array, sampling_rate=16_000, return_tensors="pt", padding=True)

with torch.no_grad():
  logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
  output = processor.batch_decode(torch.argmax(logits, dim=-1))

print("Output:", output)

```



You can listen to the sample audio here:

<audio controls>
  <source src="https://huggingface.co/ssid32/wav2vec2-xlsr-dendi-ddn-for-numerals/resolve/main/audio_test.wav" type="audio/wav">
  Your browser does not support the audio element.
</audio>

Upon processing the sample audio, the model produces the following output:

```
Output: ['zangu ihaaku nda weiguu']
```

In this case, the output represents the numeral **850** in the Dendi language.

### Evaluation result

The model's performance on a test set yields a Word Error Rate (WER) of **18.18**%.

## Authors

This model was developed by:
- Salim KORA GUERA (HuggingFace Username: [ssid32](https://huggingface.co/ssid32)) | ([email protected])
- Etienne TOVIMAFA (HuggingFace Username: [MrBendji](https://huggingface.co/MrBendji)) | ([email protected])

## Citation

```bibtex
@misc {
	author       = { {Salim KORA GUERA and Etienne TOVIMAFA} },
	title        = { wav2vec2-xlsr-dendi-ddn-for-numerals },
	year         = 2024,
	url          = { https://huggingface.co/ssid32/wav2vec2-xlsr-dendi-ddn-for-numerals },
	doi          = { 10.57967/hf/2930 },
	publisher    = { Hugging Face }
}
```

## License

The model is licensed as **CC-BY-NC 4.0**.