Open-source project
yeyupiaoling/MASR avatar
yeyupiaoling/MASR

MASR V3: A PyTorch ASR Framework Where Streaming Is a Config Flag

Pytorch实现的流式与非流式的自动语音识别框架,同时兼容在线和离线识别,目前支持Conformer、Squeezeformer、DeepSpeech2模型,支持多种数据增强方法。

727 stars115 forksPythonApache-2.0

At a glance

What is it?
MASR bundles Conformer, Squeezeformer and DeepSpeech2 behind one training and inference pipeline, with streaming and non-streaming modes selected by a single config key. The code is Apache-2.0; the pretrained weights are not in the repository.
Who is it for?
MASR fits a team that wants one PyTorch codebase for both offline transcription and streaming recognition, and that is comfortable training on its own audio rather than downloading weights. It is the wrong choice if you need a working model immediately: every pretrained checkpoint in the README points to a paid knowledge community, and the repository itself ships no weights.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 72 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What MASR Actually Replaces

The problem MASR targets is duplication. A team that needs both batch transcription and live recognition usually ends up maintaining two pipelines: an offline model trained on full utterances, and a separate streaming model with chunked attention and its own decoding logic. MASR collapses that into one training configuration. The README states that each supported model, including deepspeech2, conformer, squeezeformer and efficient_conformer, supports both streaming and non-streaming recognition, and that the mode is set by the streaming parameter in the config file. The intended audience is a Python engineer who already works with PyTorch and wants to own the training loop rather than call a hosted API. The README lists deployment targets as servers and Nvidia Jetson devices, with Android described as a future plan. Everything is written in Python and the stated environment is Anaconda 3, Python 3.11 and PyTorch 2.5.1 on Windows 11 or Ubuntu 22.04.

The Streaming Flag and What Sits Behind It

The mechanism that makes the dual-mode claim work is not described in detail in the README, but the shape of it is visible. A single architecture definition is parameterized by the streaming flag, so the same conformer or squeezeformer code path can be trained and run in either mode. Decoding is a separate axis: the project supports ctc_greedy_search, ctc_prefix_beam_search, attention_rescoring and ctc_beam_search. Those are four different trade-offs between latency and accuracy, and the README's own result tables show that the ranking is not consistent across datasets. On the AIShell Mandarin table, ctc_beam_search reports the lowest error at 0.04409 while attention_rescoring reports 0.05366 and greedy search 0.06134. On the WenetSpeech table the order flips: attention_rescoring gives 0.13523 on test_net against 0.18227 for ctc_beam_search. That inconsistency is worth reading as a signal rather than a defect. Beam search with a CTC prefix scorer and attention rescoring behave differently depending on how much the acoustic model has already absorbed, and MASR exposes all four so you can measure rather than assume. The front end is fbank or mfcc, and V3 replaced the preprocessing library with kaldi_native_fbank, which the README credits with faster preprocessing and broader platform support. Tokenization moved to sentencepiece, which the README says makes multilingual handling easier and mixed Chinese-English training possible. That last point is the most consequential architectural change from V2, because a shared subword vocabulary is what allows one model to emit Chinese characters and English words without a language-specific output layer.

Getting a Training Run Started

The README does not include a full install command sequence, so the concrete steps below are limited to what it does state. The environment is Anaconda 3, Python 3.11 and PyTorch 2.5.1, on Windows 11 or Ubuntu 22.04. The project is on the develop branch, and V3 is explicitly incompatible with V2; the README points anyone who needs the older version to the release/2.3.x branch. That is the first thing to check before cloning, because a stale tutorial written against V2 will not apply. Configuration is file-based. The streaming parameter in the config selects streaming or non-streaming, and the same file carries the model choice among deepspeech2, conformer, squeezeformer and efficient_conformer, the preprocessing choice between fbank and mfcc, and the decoding method. Augmentation is configured alongside: the README lists noise, reverberation, speed, volume, resampling, shift, SpecAugmentor and SpecSubAugmentor. Inference is exposed as four separate paths: short audio, long audio, streaming, and speaker diarization. There is a hosted demo at tools.yeyupiaoling.cn/speech/masr and a WeChat mini program, both of which let you hear the models before you build anything. What the README does not give is a requirements file listing, a pip install line, or a training entry point command, so budget time to read the repository tree before your first run.

The Weights Are Not in the Repository

This is the limitation that should decide most adoption questions. The README contains four result tables covering WenetSpeech, AIShell, Librispeech and a set of additional datasets including Cantonese, mixed Chinese-English, a 16000+ hour corpus, and Uyghur. Every single row in the download column reads the same thing: available by joining the knowledge community. The repository is Apache-2.0 licensed, but the license covers code, not checkpoints, and no checkpoint is published in the repository. So the practical starting position is that you have a training framework and no model. The reported numbers, such as 0.06134 CER for a streaming Conformer with greedy search on AIShell, are the author's results on those test sets. They are not something you can reproduce without either obtaining the weights or rerunning training on the same data. Treat them as an indication of what the architecture can reach, not as a baseline you inherit. If your project needs recognition working this week, MASR is the wrong tool, and that is a licensing and distribution decision rather than a technical one.

Where the Framework Is Thin

Beyond the weights question, several things are underspecified in the README. The streaming implementation details are not documented: chunk size, lookahead, and how the encoder state is carried between chunks are not described, yet those parameters determine latency and accuracy more than the model choice does. The README also does not state whether a model trained in non-streaming mode can be converted to streaming, or whether the two modes require separate training runs from the start. That distinction matters a great deal for planning, because training twice doubles the compute budget. On deployment, the README names servers and Nvidia Jetson devices as targets and Android as a future plan, so there is no mobile story today. The absence of releases is another signal: no releases were retrieved for this repository, which means versioning is by branch and commit rather than by tagged artifacts. If you depend on reproducible builds, pin a commit hash rather than tracking develop. Finally, the quality of the reported results varies by language in a way that is not explained. The Uyghur Conformer reports 0.04179 CER with greedy search, which is lower than the English Librispeech WER for the same decoder at 0.07432, but CER and WER are not comparable metrics, and the README's own note says Chinese results are CER, English are WER, and mixed is MER. Comparing across those columns is a category error, and the tables invite it.

MASR Against a Production-Grade Toolkit

The natural comparison is with a mature end-to-end speech toolkit such as ESPnet or WeNet, both of which also cover streaming and non-streaming recognition in PyTorch or a related stack. The difference in approach is what each project treats as the deliverable. MASR's deliverable is a readable training pipeline: one Python codebase, config-file switches for model, frontend, decoder and augmentation, and inference scripts for four input shapes. The larger toolkits tend to ship recipe directories per corpus, a wider set of published checkpoints, and more tooling around deployment. That is not a claim that MASR is smaller in scope; it is a claim about where the effort went. MASR's README spends its length on model and decoder combinations and on augmentation methods, and comparatively little on serving, batching, or checkpoint distribution. If your bottleneck is getting a streaming model trained on your own domain audio with a specific augmentation recipe, MASR's config surface is easier to reason about. If your bottleneck is getting a supported, downloadable model into production, a toolkit with published checkpoints removes a step that MASR leaves entirely to you.

Upgrade Cost and the V2 to V3 Break

MASR has already done one incompatible rewrite. The README states plainly that V3 is not compatible with V2 and directs V2 users to the release/2.3.x branch. The three changes it lists are structural: a reorganized project layout, a switch to kaldi_native_fbank for preprocessing, and a switch to sentencepiece for tokenization. The tokenizer change is the one that breaks things hardest, because a model trained under V2's token scheme cannot be loaded into a V3 pipeline without retraining. Anyone with a V2 checkpoint should stay on the 2.3.x branch or plan a full retrain. For new users the cost is lower, but the pattern is worth noting: the project has shown it will make breaking changes between major versions, and there are no tagged releases to pin against. Practically, that means vendoring a specific commit and testing upgrades deliberately. On licensing, the code is Apache-2.0, which permits commercial use and modification under its terms; the pretrained models are distributed through a separate community and their terms are not stated in the README. If model weights matter to your product, that is a question for whoever distributes them, not something the repository's license resolves. This is not legal advice, and the distinction between the code license and the weight distribution channel is the part to take to counsel.

Who Should Start Here

Adopt MASR if you are a PyTorch team that intends to train on your own audio, you need both offline and streaming recognition from one codebase, and you want the model, frontend, decoder and augmentation choices exposed as config keys rather than buried in code. The streaming flag and the four decoders give you a real experiment surface, and the sentencepiece tokenizer makes mixed Chinese-English training a first-class option rather than a workaround. Do not adopt it if you need working recognition without training. The README's download column points to a knowledge community for every checkpoint, and no releases were retrieved for the repository. Do not adopt it if you need a documented streaming latency budget, since chunk size and lookahead are not specified, or if you need Android deployment today. The first things to verify are narrow: clone develop, confirm the streaming parameter in the config actually toggles the encoder path for the model you intend to use, and establish whether you can obtain a checkpoint or must reproduce training from scratch. If the answer to that last question is reproduce, size the compute before you write any application code.

Editorial conclusion

MASR fits a team that wants one PyTorch codebase for both offline transcription and streaming recognition, and that is comfortable training on its own audio rather than downloading weights. It is the wrong choice if you need a working model immediately: every pretrained checkpoint in the README points to a paid knowledge community, and the repository itself ships no weights. Before committing, verify that the streaming Conformer config produces stable partial hypotheses on your own audio, and confirm whether you can obtain a checkpoint or reproduce training yourself.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. yeyupiaoling/MASR on GitHub
Community notes

Community notes