Skip to main content

A pure python IO interface for data accessing in kaldi

Project description

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 index
    ark_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 index
    egs_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 index
    scp_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}")
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaldi-python-io-1.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

kaldi_python_io-1.1.2-py3.7.egg (20.3 kB view details)

Uploaded Source

File details

Details for the file kaldi-python-io-1.1.2.tar.gz.

File metadata

  • Download URL: kaldi-python-io-1.1.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for kaldi-python-io-1.1.2.tar.gz
Algorithm Hash digest
SHA256 9b59bfbf468a4e0da995684aa39fb05d66178dea0b0467c2cb1cdbe9d53a1573
MD5 2c4d5d41762b97461ef99aaff7e72067
BLAKE2b-256 6c38223c67f0cf926f5bf15a417121defd60d7973f7461cb39f2b26cd7a4b682

See more details on using hashes here.

File details

Details for the file kaldi_python_io-1.1.2-py3.7.egg.

File metadata

  • Download URL: kaldi_python_io-1.1.2-py3.7.egg
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for kaldi_python_io-1.1.2-py3.7.egg
Algorithm Hash digest
SHA256 50adc770957374221df8a9c98a5e55f84df702eb170fc9fa81bd4f5a54f2e472
MD5 157616396fee675b7f4fd992f42a0346
BLAKE2b-256 d63a462dc19f1d7cef240ce49ccf4fed481f8bbc7ca058a73b705a5094c8e143

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page