프로젝트
GitHub에서 보기
KarelVesely84/kaldi-io-for-python
소개
Kaldi 데이터 형식을 읽는 Python 함수입니다. Python으로 빠르게 프로토타입을 만드는 데 유용합니다.
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalkaldi-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:
pip install kaldi_io
- from sources:
git clone https://github.com/vesis84/kaldi-io-for-python.git <kaldi-io-dir>`
pip install -r requirements.txt
pip install --editable .
Note: it is recommended to set export KALDI_ROOT=<some_kaldi_dir> environment variable.
The I/O based on pipes can then contain kaldi binaries.
Unit tests
(note: these are not included in pypi package)
Unit tests are started this way:
./run_tests.sh
or by:
python3 -m unittest discover -s tests -t .
python2 -m unittest discover -s tests -t .
License
Apache License, Version 2.0 ('LICENSE-2.0.txt')
Community
- accepting pull requests with extensions on GitHub
- accepting feedback via GitHub 'Issues' in the repo
관련 프로젝트 살펴보기
불러오는 중…