Streaming Japanese ASR that also marks fillers and repairs, trained on
CSJ + CEJC by Shinya Fujie (Fujie Lab, Chiba Institute of Technology).
CTC-only head — no decoder, greedy decoding. This is the
multitask CTC (separate N/F/D head) variant. The transcript is plain kana. The auxiliary information is a parallel label sequence (N / F / D per recognized token) from a separate head on the encoder output, so the text itself carries no markup.
Sibling models: the same three encodings with a
CTC
head (aux / comp / span)
and with an RNN-Transducer
head.
Usage
pip install "fujielab-asr>=0.2.0"
python
1import numpy as np, soundfile as sf
2from fujielab.asr.espnet_ext.espnet2.bin.asr_multitask_ctc_inference_cbs import(3 Speech2TextMultitaskCTC,4)56s2t = Speech2TextMultitaskCTC.from_pretrained(7"fujie/espnet_asr_csj_cejc_pron_aux_cbs_ctc_120300_hop132", streaming=True8)910audio, fs = sf.read("utterance.wav")# 16 kHz mono11chunk =int(16000*0.1)# 100 ms12n, result =len(audio),None13for i inrange(0, n, chunk):14 c = audio[i:i + chunk]15 is_final = i + chunk >= n # flag the last chunk even when it is full16iflen(c)< chunk:17 c = np.pad(c,(0, chunk -len(c)))18 r = s2t.streaming_decode(c, is_final=is_final)19if r:20 result = r[0]2122# tokens and aux_labels are aligned 1:123print(" ".join(f"{t}[{a}]"if a !="N"else t
24for t, a inzip(result.tokens, result.aux_labels)))
CER is computed with all auxiliary information stripped from both reference
and hypothesis, so every encoding is measured against the same target.
CER %
F: P / R / F1
D: P / R / F1
this model
16.90
80.3 / 82.8 / 81.6
55.7 / 35.2 / 43.1
By corpus: CEJC 23.75 % / CSJ 5.83 % CER.
F = filler (フィラー), D = repair / disfluent restart (言い直し). A detection
counts as correct when the predicted span overlaps a reference span of the same
type within ±1 token.
CTC vs. RNN-Transducer
A sibling model with the identical encoder, data, effective batch (32 M),
schedule (50 × 1400 steps, lr 0.0035, warmup 2500) and evaluation exists with an
RNN-Transducer head — only the head differs, so the gap is attributable to
it:
The RNN-T head wins on all three encodings (+0.33 to +1.39 points, each
significant under a paired bootstrap over utterances), but the margin varies
fourfold by encoding, so there is no single "RNN-T is N points better" figure.
Auxiliary-label quality barely depends on the head: across all six models
F F1 spans 80.4–82.0 and D F1 spans 41.6–45.5. What does change is the
precision/recall balance — the CTC models lean toward recall, the RNN-T models
are balanced — which is the more useful basis for choosing between them.
Pick CTC when you want a smaller, faster, decoder-free model and can accept
~0.3–1.4 points more CER; pick RNN-T for the best transcript.
Head: CTC only (ctc_weight 1.0, no decoder), plus a per-token auxiliary head (N/F/D) on the encoder output.
Frontend: 80-dim log-mel, hop_length 132 samples (8.25 ms) at 16 kHz,
×4 subsampling → one encoder frame per 33 ms.
Data: CSJ + CEJC, kana (pronunciation) tokens, CSJ-aligned filler
criterion (short vowel fillers えー / まあ / あー / ん also count as F).
Schedule: 50 epochs × 1400 steps, Adam lr 0.0035, warmup 2500, effective
batch 32 M bins (16 M × 2 × H100). Peak memory 55 GB.
Note on positional encoding and long audio
The encoder adds an absolute sinusoidal positional encoding indexed from the
start of the stream, and uses plain (not relative) self-attention. Training
utterances reach 19.9 s at most (498 encoder frames), so a long continuous
stream pushes the position index outside the trained range. Segment the audio
(e.g. by VAD) and let the recognizer reset per segment.
Citing ESPnet
bibtex
1@inproceedings{watanabe2018espnet,
2 author={Shinji Watanabe and Takaaki Hori and Shigeki Karita and Tomoki Hayashi
3 and Jiro Nishitoba and Yuya Unno and Nelson Yalta and Jahn Heymann
4 and Matthew Wiesner and Nanxin Chen and Adithya Renduchintala
5 and Tsubasa Ochiai},
6 title={{ESPnet}: End-to-End Speech Processing Toolkit},
7 year={2018},
8 booktitle={Proceedings of Interspeech},
9 pages={2207--2211},
10 doi={10.21437/Interspeech.2018-1456}
11}