Skip to content

Commit 693f069

Browse files
zipformer/ctc_align.py (k2-fsa#2020)
* zipformer/ctc_align.py - tool for forced-alignment with CTC model - provides timeline, computes per-token and per-utterance acoustic confidences - based on torchaudio `forced_align()` - confidences are computed in several ways other modifications: - LibriSpeechAsrDataModel extended with `::load_manifest()` to allow passing-in cutset from CLI. - update @custom_fwd @custom_bwd in scaling.py - streaming_decode.py update errs/recogs/log filenames '-' <-> '_' * putting back `custom_bwd`, `custom_fwd` * integrating remarks from PR * update of argparse help strings * ctc_align.py, avoid shadowing a variable * Finalizing the code: - adding some coderabbit suggestions. - removing `word_table`, `decoding_graph` from aligner API (unused) - improved consistency of variable names (confidences) - updated docstrings
1 parent 729a5ba commit 693f069

File tree

3 files changed

+663
-11
lines changed

3 files changed

+663
-11
lines changed

egs/librispeech/ASR/tdnn_lstm_ctc/asr_datamodule.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,14 @@ def test_dataloaders(self, cuts: CutSet) -> DataLoader:
402402
)
403403
return test_dl
404404

405+
@lru_cache()
406+
def load_manifest(self, manifest_filename: str) -> CutSet:
407+
"""
408+
Load the 'manifest' specified by an argument.
409+
"""
410+
logging.info(f"About to get '{manifest_filename}' cuts")
411+
return load_manifest_lazy(manifest_filename)
412+
405413
@lru_cache()
406414
def train_clean_5_cuts(self) -> CutSet:
407415
logging.info("mini_librispeech: About to get train-clean-5 cuts")

0 commit comments

Comments
 (0)