Skip to main content

Introduction

Kaldi's HMM-GMM reimplementation with Eigen: diagonal-covariance GMMs, HMM topology and transition model, decision trees / context dependency, training-graph compilation, MLE/MAP estimation, and GMM decodables for forced alignment and decoding — from C++ and Python, without any kaldi binaries.

The decoding engine (lattice decoders, decoder wrappers, lattice best path) lives in kaldi-decoder; this library links its C++ core and implements its DecodableInterface / TransitionInformation.

Build

git clone https://github.com/csukuangfj/kaldi-hmm-gmm
cd kaldi-hmm-gmm
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
ctest --output-on-failure

All C++ dependencies (kaldi-decoder, kaldifst/openfst, Eigen, pybind11, googletest) are fetched automatically. To build a Python wheel instead:

python setup.py bdist_wheel
pip install dist/kaldi_hmm_gmm-*.whl

The Python package kaldi_hmm_gmm is self-contained — it does not require the kaldi-decoder Python package at runtime.

Python API

import kaldi_hmm_gmm as khg

tm, am = khg.read_model("final.alimdl")     # kaldi model format
tree = khg.read_tree("tree")

decodable = khg.DecodableAmDiagGmmScaled(am=am, tm=tm, feats=feats, scale=0.1)

cfg = khg.AlignConfig(beam=10.0, retry_beam=40.0)   # kalpy/MFA defaults
num_done, num_error, _, like, frames, alignment, words = khg.align_utterance(
    config=cfg, utt="utt", acoustic_scale=0.1,
    transition_scale=1.0, self_loop_scale=0.1,
    trans_model=tm, fst=training_graph, decodable=decodable)

See the documentation for the full API and two complete tutorials.

Examples

  • yesno (egs/yesno) — the kaldi egs/yesno/s5 recipe, stage by stage: train a monophone GMM (40 iterations), build HCLG, decode, score. Run it with cd egs/yesno && ./run.sh. The corpus is the OpenSLR waves_yesno release; the script fetches the same tarball from a github.com mirror to reduce CI download time.
  • MFA forced alignment (tools/align_mfa.py) — align a single utterance to its transcript with pretrained MFA acoustic models (English english_mfa, Chinese aishell3_pinyin / large_pinyin) and produce Praat TextGrids. Test audio: en.wav / zh.wav. Every run reports the audio duration, elapsed seconds and the real-time factor (RTF); the .github/workflows/mfa.yaml CI runs both languages and uploads the TextGrids next to the audio.

Both are documented in detail in the documentation (docs/source/usage/), including environment setup (no C++ build needed — pip install kaldi-hmm-gmm) and copy-paste runnable commands.

Colab notebooks

Run the MFA examples in your browser:

  • MFA forced alignment — English Open In Colab
  • MFA forced alignment — Chinese Open In Colab

Documentation

cd docs
pip install -r requirements.txt   # + doxygen
make html

Then open docs/build/html/index.html. The C++ API reference is generated by doxygen (linked from the C++ API pages) and the Python API is rendered with autodoc.

See also

Metadata

Release files for kaldi-hmm-gmm 1.3.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kaldi-hmm-gmm 1.3.10
File Size Uploaded Provenance Actions
kaldi_hmm_gmm-1.3.10.tar.gz 247.1 kB Without provenance Details for kaldi_hmm_gmm-1.3.10.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kaldi-hmm-gmm 1.3.10
File Actions
kaldi_hmm_gmm-1.3.10-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp315-cp315-macosx_10_15_universal2.whl CPython 3.15 CPython 3.15 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp315-cp315-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp314-cp314-macosx_10_15_universal2.whl CPython 3.14 CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp314-cp314-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp313-cp313-macosx_10_15_universal2.whl CPython 3.13 CPython 3.13 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp313-cp313-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp312-cp312-macosx_10_15_universal2.whl CPython 3.12 CPython 3.12 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp312-cp312-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp311-cp311-macosx_10_15_universal2.whl CPython 3.11 CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp311-cp311-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp310-cp310-macosx_10_15_universal2.whl CPython 3.10 CPython 3.10 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp310-cp310-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp39-cp39-macosx_10_15_universal2.whl CPython 3.9 CPython 3.9 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp39-cp39-macosx_10_15_universal2.whl
kaldi_hmm_gmm-1.3.10-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details for kaldi_hmm_gmm-1.3.10-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kaldi_hmm_gmm-1.3.10-cp38-cp38-macosx_10_15_universal2.whl CPython 3.8 CPython 3.8 macOS 10.15+ universal2 (ARM64, x86-64) Details for kaldi_hmm_gmm-1.3.10-cp38-cp38-macosx_10_15_universal2.whl

Total release size: 40.2 MB

Release files / kaldi_hmm_gmm-1.3.10.tar.gz

Download URL kaldi_hmm_gmm-1.3.10.tar.gz
Size 247.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7bbb4e75804bca6213c8b4bef8ac1507b61d689e3b4bd1692a537ed0587ed20e
BLAKE2b-256 checksum
How to use checksums
0b867eed2635734b857710ec101e8a127b391f1d4d29ba85a582de6539f5fa3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.15 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
372473a5c0947d3082c08950f8b16e5fce7943e076ff51daaa1813f04f74e68c
BLAKE2b-256 checksum
How to use checksums
087f73ba0759eceaf5de8c29e3c044cb9c967b1e3b3beac036895199b39621a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp315-cp315-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp315-cp315-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.15 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
fbb48e162c907bc97bf7f10002c9ee6583c118f84b250b6ac30ac665bbd1d2d4
BLAKE2b-256 checksum
How to use checksums
56b11a547a9703c6b25c80968d061fc4448166b6e648ce65236027330ba643ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0396d3e128b86412e6c6cc42dfa0872c5d150017b2a8b4bbb099896684067f37
BLAKE2b-256 checksum
How to use checksums
e5ee081badd3347fb58218ea9ba58915c59b7f186b0f3a07d27118bd62a51aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp314-cp314-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp314-cp314-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
51fde32e8bfb161bb9cf3f2d62d2b3bd256f1e2ccc54803f791aa5d5485d91a5
BLAKE2b-256 checksum
How to use checksums
6863ba972d14b04b0f100a8393f40cd4e72309d74330a9019a60324c7c788aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6bd55e6001e3430cb74399478655fc79b5201568399b264579880464e700a501
BLAKE2b-256 checksum
How to use checksums
1c5badf60b87df6c9a6bc4272d94e798eb00b0643161f4015bd3e4215595bd05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp313-cp313-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp313-cp313-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.13 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
2a587dadc298b03e6ce759381ae1296d250e09161a8e8a36d04e683dbbf61f31
BLAKE2b-256 checksum
How to use checksums
cf8e16da122a8a0d4bf90ee5a1b745a11b0eda70a8d03342389c5cce0e394aa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4ab73a2e5909d7b535ac322ee3ffec935c0977214144c845532b3386a18541a1
BLAKE2b-256 checksum
How to use checksums
ab8a26ed9aa6fee35c82fac556a60615f2565b9e6ef177112a1c3a4bcedf3d42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp312-cp312-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp312-cp312-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.12 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
46c0f13f9dfe73e8109057604f98de23223f1863bb0db14cbded20ff092de662
BLAKE2b-256 checksum
How to use checksums
9e7a46fef087b3b3fd7b113f6f76822725cff9fdee3c22da48c7b0c58ace8501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
37f33a7742b186adf033722aff8288ee126fdf125ff0b343156b70c9aeb59910
BLAKE2b-256 checksum
How to use checksums
37ab7ff8a0b4d117c35c0de85eccbf7813fc9d2ff91637509198b2c7764738f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp311-cp311-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp311-cp311-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
611010db8d57ba9260303e03b0be28f5907312f34d78c0c2f2365e4122a8b058
BLAKE2b-256 checksum
How to use checksums
2d4ad089f31df9da6633971314fc7dcb91448b2dd2bf235325ea5facaee42b2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
83f55002987662fe7068b2a452dce8639784dd8d07dd959db600afd23fd7f7d0
BLAKE2b-256 checksum
How to use checksums
2c5e56d4528906a9c5dd49519087fa82fc0a1a3e538f546f7812cd3e1d683054
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp310-cp310-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp310-cp310-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.10 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
2a6626adad2c1667f970635161f03fe98312e0e1fdf37afbc424b972db2b3267
BLAKE2b-256 checksum
How to use checksums
1c235150c87da547c366b37cb5927e595fcbce646477c5f729acb0fd4b194f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e2b7d165e3d7c3059b7950d01525c840dbd89c9d63311b67eaafb65a3f51522a
BLAKE2b-256 checksum
How to use checksums
349bbcdf26724df10d389b7f5fb8b9a81e03c1ab07284593cf71a66b0919a0dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp39-cp39-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp39-cp39-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.9 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
37d3dc3df096b0a5537391b00134cfcc1c703a43cccbc80065002e686c00d813
BLAKE2b-256 checksum
How to use checksums
61c1a95c0e251c4d045b1b63acbe02749fdc941c75c8f3544561ecb1ca2cf954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Release files / kaldi_hmm_gmm-1.3.10-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kaldi_hmm_gmm-1.3.10-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
579b258146b282d6783d99922514efcb73bc2e2ae13e6ad216d67307b4548995
BLAKE2b-256 checksum
How to use checksums
444ffecdc63953fd635b460bf12c6ca6fa2bcd97f1e16fb0ebfc7c4c77289017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.14.4

Release files / kaldi_hmm_gmm-1.3.10-cp38-cp38-macosx_10_15_universal2.whl

Download URL kaldi_hmm_gmm-1.3.10-cp38-cp38-macosx_10_15_universal2.whl
Size 2.9 MB
Tags CPython 3.8 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
30903a13f3a4b4e6b0e51566117d01395e2f9c1d01c6dced44240dd037078827
BLAKE2b-256 checksum
How to use checksums
29396fbc86397feaeb1739faa385ee56731ff4cfcca76e7394dedcea80e4879d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.15.2

Security for kaldi-hmm-gmm 1.3.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page