资源算法kaldi-python-io

kaldi-python-io

2020-04-07 | |  46 |   0 |   0

Kaldi Python IO

A python (3.6+) wrapper for Kaldi's data accessing.

Support Type

  • Kaldi's binary archives (*.ark)

  • Kaldi's scripts (alignments & features, *.scp)

  • Kaldi nnet3 data examples in binary (*.egs)

Install

python setup.py install or pip install kaldi-python-io

Usage

  • ArchiveReader && AlignArchiveReader

    # allow only sequential indexark_reader = ArchiveReader("copy-feats ark:foo.ark ark:- |")for key, _ in ark_reader:    print(key)
    ali_reader = AlignArchiveReader("gunzip -c foo.ali.gz |")for key, _ in ark_reader:    print(key)
  • Nnet3EgsReader

    # allow only sequential indexegs_reader = Nnet3EgsReader("foo.egs")for key, _ in egs_reader:    print(key)
  • ArchiveWriter

    with ArchiveWriter("foo.ark", "foo.scp") as writer:    for i in range(10):
            mat = np.random.rand(100, 20)
            writer.write(f"mat-{i}", mat)
  • ScriptReader && AlignScriptReader

    # allow sequential/random indexscp_reader = ScriptReader("shuf foo.scp | head -n 2")for key, mat in scp_reader:    print(f"{key}: {mat.shape}")
    ali_reader = AlignScriptReader("foo.ali.scp")for key, ali in ali_reader:    print(f"{key}: {ali.shape}")


上一篇:kaldi-svn-archive

下一篇:kaldi-adapt-lm

用户评价
全部评价

热门资源

  • TensorFlow-Course

    This repository aims to provide simple and read...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • mxnet_VanillaCNN

    This is a mxnet implementation of the Vanilla C...

  • DuReader_QANet_BiDAF

    Machine Reading Comprehension on DuReader Usin...

  • Klukshu-Sockeye-...

    KLUKSHU SOCKEYE PROJECTS 2016 This repositor...