A mini, simple, and fast end-to-end automatic speech recognition toolkit.
MIT License
A mini, simple, and fast end-to-end automatic speech recognition toolkit.
run_preprocess.py
)
run_asr.py
)
miniasr/data/dataset.py
)
miniasr/data/text.py
)miniasr/data/dataloader.py
)miniasr/model/base_asr.py
)
run_asr.py
)
v0.4
)git clone https://github.com/s3prl/s3prl.git
cd s3prl
pip install -e ./
cd ..
pip install -e ./
Additional libraries:
You can directly use pre-trained ASR models for any applications. (under construction 🚧)
from miniasr.utils import load_from_checkpoint
from miniasr.data.audio import load_waveform
# Option 1: Loading from a checkpoint
model, args, tokenizer = load_from_checkpoint('path/to/ckpt', 'cuda')
# Option 2: Loading from torch.hub (TODO)
model = torch.hub.load('vectominist/MiniASR', 'ctc_eng').to('cuda')
# Load waveforms and recognize!
waves = [load_waveform('path/to/waveform').to('cuda')]
hyps = model.recognize(waves)
egs/
.miniasr/preprocess
.Options:
--corpus Corpus name.
--path Path to dataset.
--set Which subsets to be processed.
--out Output directory.
--gen-vocab Specify whether to generate vocabulary files.
--char-vocab-size Character vocabulary size.
--word-vocab-size Word vocabulary size.
--subword-vocab-size Subword vocabulary size.
--gen-subword Specify whether to generate subword vocabulary.
--subword-mode {unigram,bpe} Subword training mode.
--char-coverage Character coverage.
--seed SEED Set random seed.
--njobs Number of workers.
--log-file Logging file.
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} Logging level.
See examples in egs/
.
Options:
--config Training configuration file (.yaml).
--test Specify testing mode.
--ckpt Checkpoint for testing.
--test-name Specify testing results' name.
--cpu Using CPU only.
--seed Set random seed.
--njobs Number of workers.
--log-file Logging file.
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} Logging level.
torch.hub
support@misc{chang2021miniasr,
title={{MiniASR}},
author={Chang, Heng-Jui},
year={2021},
url={https://github.com/vectominist/MiniASR}
}