CoolFace
Modelpublic

moumeneb1/testing

sourceHugging Faceapache-2.0updated 5y agoView on Hugging Face
0likes10downloads
README.md118 linesDownload Raw Back to root
1---2language: "rw"3thumbnail:4pipeline_tag: automatic-speech-recognition5tags:6- CTC7- Attention8- pytorch9- speechbrain10- Transformer11license: "apache-2.0"12datasets:13- commonvoice14metrics:15- wer16- cer17---18 19<iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>20<br/><br/>21 22# wav2vec 2.0 with CTC/Attention trained on CommonVoice Kinyarwanda (No LM)23 24This repository provides all the necessary tools to perform automatic speech25recognition from an end-to-end system pretrained on CommonVoice (Kinyarwanda Language) within26SpeechBrain. For a better experience, we encourage you to learn more about27[SpeechBrain](https://speechbrain.github.io). 28 29The performance of the model is the following:30 31| Release | Test WER | GPUs |32|:--------------:|:--------------:| :--------:|33| 03-06-21 | 18.91 | 2xV100 32GB |34 35## Pipeline description36 37This ASR system is composed of 2 different but linked blocks:38- Tokenizer (unigram) that transforms words into subword units and trained with39the train transcriptions (train.tsv) of CommonVoice (RW).40- Acoustic model (wav2vec2.0 + CTC/Attention). A pretrained wav2vec 2.0 model ([wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53)) is combined with two DNN layers and finetuned on CommonVoice En. 41The obtained final acoustic representation is given to the CTC and attention decoders.42 43The system is trained with recordings sampled at 16kHz (single channel).44The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *transcribe_file* if needed.45 46## Install SpeechBrain47 48First of all, please install tranformers and SpeechBrain with the following command:49 50```51pip install speechbrain transformers52```53 54Please notice that we encourage you to read our tutorials and learn more about55[SpeechBrain](https://speechbrain.github.io).56 57### Transcribing your own audio files (in Kinyarwanda)58 59```python60from speechbrain.pretrained import EncoderDecoderASR61 62asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-rw", savedir="pretrained_models/asr-wav2vec2-commonvoice-rw")63asr_model.transcribe_file("speechbrain/asr-wav2vec2-commonvoice-rw/example.mp3")64 65```66### Inference on GPU67To perform inference on the GPU, add  `run_opts={"device":"cuda"}`  when calling the `from_hparams` method.68 69## Parallel Inference on a Batch70Please, [see this Colab notebook](https://colab.research.google.com/drive/1hX5ZI9S4jHIjahFCZnhwwQmFoGAi3tmu?usp=sharing) to figure out how to transcribe in parallel a batch of input sentences using a pre-trained model.71 72### Training73The model was trained with SpeechBrain.74To train it from scratch follow these steps:751. Clone SpeechBrain:76```bash77git clone https://github.com/speechbrain/speechbrain/78```792. Install it:80```bash81cd speechbrain82pip install -r requirements.txt83pip install -e .84```85 863. Run Training:87```bash88cd recipes/CommonVoice/ASR/seq2seq89python train_with_wav2vec.py hparams/train_rw_with_wav2vec.yaml --data_folder=your_data_folder90```91 92You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1tjz6IZmVRkuRE97E7h1cXFoGTer7pT73?usp=sharing).93 94### Limitations95The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.96 97# **About SpeechBrain**98- Website: https://speechbrain.github.io/99- Code: https://github.com/speechbrain/speechbrain/100- HuggingFace: https://huggingface.co/speechbrain/101 102 103# **Citing SpeechBrain**104Please, cite SpeechBrain if you use it for your research or business.105 106 107```bibtex108@misc{speechbrain,109  title={{SpeechBrain}: A General-Purpose Speech Toolkit},110  author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},111  year={2021},112  eprint={2106.04624},113  archivePrefix={arXiv},114  primaryClass={eess.AS},115  note={arXiv:2106.04624}116}117```118