Model reference · open weights
bp500-base100k_voxpopuli is an open-weight audio or speech model from lgris. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | lgris |
|---|---|
| Type | Audio & music |
| Task | Speech→text |
| Runs with | transformers |
| Released | 2022-03-02 |
| Popularity | 5k downloads / month |
| Licence | Open weights |
About
This is a the demonstration of a fine-tuned Wav2vec model for Brazilian Portuguese using the following datasets:
These datasets were combined to build a larger Brazilian Portuguese dataset. All data was used for training except Common Voice dev/test sets, that were used for validation/test respectively. We also made test sets for all the gathered datasets.
| Dataset | Train | Valid | Test |
|---|---|---|---|
| CETUC | 94.0h | -- | 5.4h |
| Common Voice | 37.8h | 8.9h | 9.5h |
| LaPS BM | 0.8h | -- | 0.1h |
| MLS | 161.0h | -- | 3.7h |
| Multilingual TEDx (Portuguese) | 148.9h | -- | 1.8h |
| SID | 7.2h | -- | 1.0h |
| VoxForge | 3.9h | -- | 0.1h |
| Total | 453.6h | 8.9h | 21.6h |
The original model was fine-tuned using fairseq. This notebook uses a converted version of the original one. The link to the original fairseq model is available here.
| CETUC | CV | LaPS | MLS | SID | TEDx | VF | AVG | |
|---|---|---|---|---|---|---|---|---|
| bp_500-base100k_voxpopuli (demonstration below) | 0.142 | 0.201 | 0.052 | 0.224 | 0.102 | 0.317 | 0.048 | 0.155 |
| bp_500-base100k_voxpopuli + 4-gram (demonstration below) | 0.099 | 0.149 | 0.047 | 0.192 | 0.115 | 0.371 | 0.127 | 0.157 |
| Text | Transcription |
|---|---|
| qual o instagram dele | qualo está gramedele |
| o capitão foi expulso do exército porque era doido | o capitãl foi exposo do exército porque era doido |
| também por que não | também porque não |
| não existe tempo como o presente | não existe tempo como o presente |
| eu pulei para salvar rachel | eu pulei para salvar haquel |
| augusto cezar passos marinho | augusto cesa passoesmarinho |
MODEL_NAME = "lgris/bp500-base100k_voxpopuli"
%%capture
!pip install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio===0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
!pip install datasets
!pip install jiwer
!pip install transformers
!pip install soundfile
!pip install pyctcdecode
!pip install https://github.com/kpu/kenlm/archive/master.zip
import jiwer
import torchaudio
from datasets import load_dataset, load_metric
from transformers import (
Wav2Vec2ForCTC,
Wav2Vec2Processor,
)
from pyctcdecode import build_ctcdecoder
import torch
import re
import sys
chars_to_ignore_regex = '[\,\?\.\!\;\:\"]' # noqa: W605
def map_to_array(batch):
speech, _ = torchaudio.load(batch["path"])
batch["speech"] = speech.squeeze(0).numpy()
batch["sampling_rate"] = 16_000
batch["sentence"] = re.sub(chars_to_ignore_regex, '', batch["sentence"]).lower().replace("’", "'")
batch["target"] = batch["sentence"]
return batch
def calc_metrics(truths, hypoFrom the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys bp500-base100k-voxpopuli for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (bp500-base100k-voxpopuli below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/audio/transcriptions \ -H "Authorization: Bearer $AXFORGE_API_KEY" \ -F model="bp500-base100k-voxpopuli" -F file=@audio.mp3
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.