Giter Site home page Giter Site logo

wenwanchen / kaldi-io-for-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karelvesely84/kaldi-io-for-python

0.0 0.0 0.0 325 KB

Python functions for reading kaldi data formats. Useful for rapid prototyping with python.

License: Apache License 2.0

Python 95.88% Shell 4.12%

kaldi-io-for-python's Introduction

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_io
for key,mat in kaldi_io.read_mat_scp(file):
  ...
Writing feature ark to file/stream:
import kaldi_io
with 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 as export 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: [email protected]

kaldi-io-for-python's People

Contributors

karelvesely84 avatar florian1990 avatar oplatek avatar xx205 avatar bobchennan avatar hawkaaron avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.