Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A pure python module for reading and writing kaldi ark files
| Date | Stars |
|---|---|
| 2026-07-24 | 268 |
| 2026-07-25 | 268 |
| 2026-07-28 | 268 |
| 2026-07-30 | 268 |
| 2026-08-06 | 268 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Kaldiio
[](https://pypi.python.org/pypi/kaldiio)
[](https://pypi.python.org/pypi/kaldiio)
[](https://codecov.io/gh/nttcslab-sp/kaldiio)
A pure python module for reading and writing kaldi ark files
- [Introduction](#introduction)
- [What is this? What are `ark` and `scp`?](#what-is-this-what-are-ark-and-scp)
- [Features](#features)
- [Similar projects](#similar-projects)
- [Install](#install)
- [Usage](#usage)
- [ReadHelper](#readhelper)
- [WriteHelper](#writehelper)
- [More low level API](#more-low-level-api)
## Introduction
### What are `ark` and `scp`?
`kaldiio` is an IO utility implemented in pure Python language for several file formats used in [kaldi](https://github.com/kaldi-asr/kaldi), which are named as`ark` and `scp`. `ark` and `scp` are used in in order to archive some objects defined in Kaldi, typically it is Matrix object of Kaldi.
In this section, we describe the basic concept of `ark` and `scp`. More detail about the File-IO in `Kaldi-asr`: http://kaldi-asr.org/doc/io.html
#### Basic of File IO in kaldi: Ark and copy-feats
`ark` is an archive format to save any `Kaldi objects`. This library mainly support `KaldiMatrix/KaldiVector`.
This ia an example of ark file of KaldiMatrix: [ark file](tests/arks/test.ark)
If you have `Kaldi`, you can convert it to text format as following
```bash
# copy-feats <read-specifier> <write-specifier>
copy-feats ark:test.ark ark,t:text.ark
```
`copy-feats` is designed to have high affinity with unix command line:
1. `ark` can be flushed to and from unix pipe.
cat test.ark | copy-feats ark:- ark,t:- | less # Show the contents in the ark
`-` indicates standard input stream or output stream.
1. Unix command can be used as `read-specifier` and `wspecifier`
copy-feats ark:'gunzip -c some.ark.gz |' ark:some.ark
#### Scp file
`scp` is a text file such as,
```
uttid1 /some/where/feats.ark:123
uttid2 /some/where/feats.ark:156
uttid3 /some/where/feats.ark:245
```
The first column, `uttid1`, indicates the utterance id and the second, `/some/where/feats.ark:123`, is the file path of matrix/vector of kaldi formats. The number after colon is a starting addressof the object of the file.
`scp` looks very simple format, but has several powerful features.
1. Mutual conversion between`ark` and `scp`
copy-feats scp:foo.scp ark:foo.ark # scp -> ark
copy-feats ark:foo.ark ark,scp:bar.ark,bar.scp # ark -> ark,scp
1. Unix command can be used insead of direct file path
For example, the following scp file can be also used.
uttid1 cat /some/where/feats1.mat |
uttid2 cat /some/where/feats2.mat |
uttid3 cat /some/where/feats3.mat |
#### wav.scp
`wav.scp` is a `scp` to describe wave file paths.
```
uttid1 /some/path/a.wav
uttid2 /some/path/b.wav
uttid3 /some/path/c.wav
```
`wav.scp` is also can be embeded unix command as normal scp file. This is often used for converting file format in kaldi recipes.
```
uttid1 sph2pipe -f wav /some/path/a.wv1 |
uttid2 sph2pipe -f wav /some/path/b.wv1 |
uttid3 sph2pipe -f wav /some/path/c.wv1 |
```
### Features
Kaldiio supports:
- Read/Write for archive formats: ark, scp
- Binary/Text - Float/Double Matrix: DM, FM
- Binary/Text - Float/Double Vector: DV, FV
- Compressed Matrix for loading: CM, CM2, CM3
- Compressed Matrix for writing: All compressoin_method are supported: 1,2,3,4,5,6,7
- Binary/Text for Int-vector, typically used for `ali` files.
- Read/Write via a pipe: e.g. "ark: cat feats.ark |"
- Read wav.scp / wav.ark
- (New!) Some extended ark format **not supported** in Kaldi originally.
- The ark file for numpy, pickle, wav, flac files.
The followings are **not supported**
- Write in existing scp file
- NNet2/NNet3 egs
- Lattice filExcerpt of 12,609 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:faf01a29d4807828, topic:speech-recognition