资源算法kaldi-io-for-python

kaldi-io-for-python

2019-12-25 | |  37 |   0 |   0

kaldi-io-for-python

``Glue'' code connecting kaldi data and python.

Supported data types

  • vector (integer)

  • Vector (float, double)

  • Matrix (float, double)

  • Posterior (posteriors, nnet1 training targets, confusion networks, ...)

Examples

Reading feature scp example:
import kaldi_iofor key,mat in kaldi_io.read_mat_scp(file):  ...
Writing feature ark to file/stream:
import kaldi_iowith open(ark_file,'wb') as f:  for key,mat in dict.iteritems(): 
    kaldi_io.write_mat(f, mat, key=key)
Writing features as 'ark,scp' by pipeline with 'copy-feats':
import kaldi_io
ark_scp_output='ark:| copy-feats --compress=true ark:- ark,scp:data/feats2.ark,data/feats2.scp'with kaldi_io.open_or_fd(ark_scp_output,'wb') as f:  for key,mat in dict.iteritems(): 
    kaldi_io.write_mat(f, mat, key=key)

Install

  • from pypi: python -m pip --user install kaldi_io

  • from sources:

    • git clone https://github.com/vesis84/kaldi-io-for-python.git <kaldi-io-dir>

    • python setup.py install (default python)

  • for local development use: export PYTHONPATH=${PYTHONPATH}:<kaldi-io-dir> in $HOME/.bashrc

Note: it is recommended to set $KALDI_ROOT in your $HOME/.bashrc asexport KALDI_ROOT=<some_kaldi_dir>, so you can read/write using pipes which contain kaldi binaries.

License

Apache License, Version 2.0 ('LICENSE-2.0.txt')

Contact

  • If you have an extension to share, please create a pull request.

  • For feedback and suggestions, please create a GitHub 'Issue' in the project.

  • For the positive reactions =) I am also reachable by email: vesis84@gmail.com


上一篇:kaldi-lstm

下一篇:Kaldi

用户评价
全部评价

热门资源

  • seetafaceJNI

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

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...