Official implementation of Whisper-Pinyin, a Pinyin-level speech model for Mandarin speech assessment.
AISHELL-3 Test SetWhisper-Pinyin with cross-augmentation consistency regularization achieves an 18.6% relative reduction in token error rate over the Whisper-OTC baseline on the AISHELL-3 test set.
|
|
Detailed results can be found in
results/results_cross_continuous_aishell3_test.txt
and
results/results_otc_aishell3_test.txt
Try Whisper-Pinyin directly in the browser with the hosted Hugging Face Space: walston/whisper-pinyin-demo.
The demo runs the cross-augmentation continuous checkpoint from the walston/whisper-pinyin model repository. On the public CPU Space, decoding runs at approximately RTF 1.76.
git clone https://github.com/oshindow/whisper_pinyin.git
cd whisper_pinyin
conda create -n whisper-pinyin python=3.8 ffmpeg -y
conda activate whisper-pinyin
pip install -r requirements.txt
pip install pytorch-lightning==2.4.0 --no-deps
python -c "import torch, torchaudio, k2; print(torch.__version__)"
This repository already provides AISHELL-3 text manifests under:
dump/aishell3/train/text
dump/aishell3/val/text
dump/aishell3/val/text_100
dump/aishell3/test/text
You only need to prepare the AISHELL-3 audio files. Convert all audio to 16 kHz, 16-bit, mono-channel WAV files and place them with the expected directory layout:
<data-root>/aishell3/
train/wav_16k/<speaker_id>/<utt_id>.wav
test/wav_16k/<speaker_id>/<utt_id>.wav
dump/aishell3/val/text_100 is a 100-utterance validation subset randomly sampled from dump/aishell3/val/text.
Before training, update DATA_ROOT and EXP_DIR in run.sh to match your local paths.
The provided run.sh launches the Whisper-Pinyin with Cross-augmentation (continuous) experiment:
./run.sh
Recommended setting for a single NVIDIA RTX A5000 with 24 GB VRAM:
Recommended setting for a single NVIDIA RTX A5000 with 24 GB VRAM:
CUDA_VISIBLE_DEVICES=0 python scripts/baseline/finetuning_pinyin_otc.py \
--epoch 10 \
--data-root $DATA_ROOT \
--train-name whisper_pinyin_aishell3_otc \
--train-id 001 \
--exp-dir $EXP_DIR \
--train-path dump/aishell3/train/text \
--model-name small \
--ctc-layers 2 \
--n_mels 80 \
--batch-size 16 \
--precision bf16-mixed \
--learning-rate 1e-4 \
--weight-decay 0.01 \
--adam-epsilon 1e-8 \
--warmup-steps 1000 > exp_whisper_otc.log
Run Whisper-Pinyin inference on the AISHELL-3 test manifest:
CUDA_VISIBLE_DEVICES=0 python inference/inference_pinyin_ctc.py \
--checkpoint path/to/your/checkpoint \
--test-path dump/aishell3/test/text \
--output results_aishell3_test.txt
Run Wav2Vec2 baseline inference:
CUDA_VISIBLE_DEVICES=0 python inference/inference_pinyin_ctc_w2v.py \
--checkpoint path/to/your/checkpoint \
--test-path dump/aishell3/test/text \
--output results_w2v_aishell3_test.txt
LICENSES/ for third-party license references.20 commits
Python
99.6%
Official implementation of Whisper-Pinyin, a Pinyin-level speech model for Mandarin speech assessment.
AISHELL-3 Test SetWhisper-Pinyin with cross-augmentation consistency regularization achieves an 18.6% relative reduction in token error rate over the Whisper-OTC baseline on the AISHELL-3 test set.
|
|
Detailed results can be found in
results/results_cross_continuous_aishell3_test.txt
and
results/results_otc_aishell3_test.txt
Try Whisper-Pinyin directly in the browser with the hosted Hugging Face Space: walston/whisper-pinyin-demo.
The demo runs the cross-augmentation continuous checkpoint from the walston/whisper-pinyin model repository. On the public CPU Space, decoding runs at approximately RTF 1.76.
git clone https://github.com/oshindow/whisper_pinyin.git
cd whisper_pinyin
conda create -n whisper-pinyin python=3.8 ffmpeg -y
conda activate whisper-pinyin
pip install -r requirements.txt
pip install pytorch-lightning==2.4.0 --no-deps
python -c "import torch, torchaudio, k2; print(torch.__version__)"
This repository already provides AISHELL-3 text manifests under:
dump/aishell3/train/text
dump/aishell3/val/text
dump/aishell3/val/text_100
dump/aishell3/test/text
You only need to prepare the AISHELL-3 audio files. Convert all audio to 16 kHz, 16-bit, mono-channel WAV files and place them with the expected directory layout:
<data-root>/aishell3/
train/wav_16k/<speaker_id>/<utt_id>.wav
test/wav_16k/<speaker_id>/<utt_id>.wav
dump/aishell3/val/text_100 is a 100-utterance validation subset randomly sampled from dump/aishell3/val/text.
Before training, update DATA_ROOT and EXP_DIR in run.sh to match your local paths.
The provided run.sh launches the Whisper-Pinyin with Cross-augmentation (continuous) experiment:
./run.sh
Recommended setting for a single NVIDIA RTX A5000 with 24 GB VRAM:
Recommended setting for a single NVIDIA RTX A5000 with 24 GB VRAM:
CUDA_VISIBLE_DEVICES=0 python scripts/baseline/finetuning_pinyin_otc.py \
--epoch 10 \
--data-root $DATA_ROOT \
--train-name whisper_pinyin_aishell3_otc \
--train-id 001 \
--exp-dir $EXP_DIR \
--train-path dump/aishell3/train/text \
--model-name small \
--ctc-layers 2 \
--n_mels 80 \
--batch-size 16 \
--precision bf16-mixed \
--learning-rate 1e-4 \
--weight-decay 0.01 \
--adam-epsilon 1e-8 \
--warmup-steps 1000 > exp_whisper_otc.log
Run Whisper-Pinyin inference on the AISHELL-3 test manifest:
CUDA_VISIBLE_DEVICES=0 python inference/inference_pinyin_ctc.py \
--checkpoint path/to/your/checkpoint \
--test-path dump/aishell3/test/text \
--output results_aishell3_test.txt
Run Wav2Vec2 baseline inference:
CUDA_VISIBLE_DEVICES=0 python inference/inference_pinyin_ctc_w2v.py \
--checkpoint path/to/your/checkpoint \
--test-path dump/aishell3/test/text \
--output results_w2v_aishell3_test.txt
LICENSES/ for third-party license references.20 commits
Python
99.6%