XHxiehuan/icefall-asr-aishell-streaming-zipformer-small
0
Streaming Zipformer (Small) — AISHELL-1 ASR
Streaming (causal) Zipformer2 model for Mandarin Chinese ASR, trained on AISHELL-1. Trained with icefall using pruned RNN-T loss.
Model Description
- Architecture: Zipformer2 (small, causal/streaming)
- Task: Automatic Speech Recognition (Mandarin Chinese)
- Dataset: AISHELL-1 (~170 hours)
- Parameters: ~23M
- Streaming: Yes — chunk-size 16 frames (~320ms latency)
- Training framework: icefall + k2
Model Architecture
Training Details
Evaluation Results (CER)
Evaluated using greedy search, chunk-size=16, left-context=64.
Note: This is a streaming model. Non-streaming models typically achieve lower CER (~4-5%) due to full context access.
Files
Usage
Load PyTorch weights
import torch
from zipformer import Zipformer2 # from icefall
checkpoint = torch.load("pretrained.pt", map_location="cpu")
model.load_state_dict(checkpoint["model"])
model.eval()Run inference with icefall
# Clone icefall
git clone https://github.com/k2-fsa/icefall
cd icefall/egs/aishell/ASR
# Greedy search inference on a wav file
python zipformer/pretrained.py \
--checkpoint /path/to/pretrained.pt \
--tokens /path/to/tokens.txt \
--causal 1 \
--chunk-size 16 \
--left-context-frames 64 \
--method greedy_search \
/path/to/audio.wavRun inference with sherpa-onnx (recommended for deployment)
sherpa-onnx supports streaming inference using the ONNX files directly, with Python, C++, Android, iOS, and more.
pip install sherpa-onnx
python -c "
import sherpa_onnx
recognizer = sherpa_onnx.OnlineRecognizer.from_transducer(
encoder='encoder-epoch-30-avg-9-chunk-16-left-64.onnx',
decoder='decoder-epoch-30-avg-9-chunk-16-left-64.onnx',
joiner='joiner-epoch-30-avg-9-chunk-16-left-64.onnx',
tokens='tokens.txt',
num_threads=4,
decoding_method='greedy_search',
)
"Citation
If you use this model, please cite:
@inproceedings{yao2023zipformer,
title={Zipformer: A faster and better encoder for automatic speech recognition},
author={Yao, Zengwei and Guo, Liyong and Yang, Xiaoyu and Kang, Wei and Lhotse, Daniel and Yang, Fangjun and Wang, Wei and Povey, Daniel},
booktitle={ICLR},
year={2024}
}
@inproceedings{bu2017aishell,
title={AISHELL-1: An open-source Mandarin speech corpus and a speech recognition baseline},
author={Bu, Hui and Du, Jiayu and Na, Xingyu and Wu, Bengu and Zheng, Hao},
booktitle={Proceedings of OCOCOSDA},
year={2017}
}License
Apache 2.0
