{ "info": { "author": "David Zurow", "author_email": "daanzu@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Affero General Public License v3", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9" ], "description": "# Kaldi Active Grammar\n\n> **Python Kaldi speech recognition with grammars that can be set active/inactive dynamically at decode-time**\n\n> Python package developed to enable context-based command & control of computer applications, as in the [Dragonfly](https://github.com/dictation-toolbox/dragonfly) speech recognition framework, using the [Kaldi](https://github.com/kaldi-asr/kaldi) automatic speech recognition engine.\n\n[](https://pypi.python.org/pypi/kaldi-active-grammar/)\n[](https://pypi.python.org/pypi/kaldi-active-grammar/)\n[](https://pypi.python.org/pypi/kaldi-active-grammar/)\n[](https://pypi.python.org/pypi/kaldi-active-grammar/)\n[](https://github.com/daanzu/kaldi-active-grammar/releases)\n\n\n[](https://github.com/daanzu/kaldi-active-grammar/releases)\n\n[](https://gitter.im/kaldi-active-grammar/community)\n\n[](https://github.com/sponsors/daanzu)\n[](https://www.patreon.com/daanzu)\n[](https://paypal.me/daanzu)\n[](https://github.com/sponsors/daanzu)\n\nNormally, Kaldi decoding graphs are **monolithic**, require **expensive up-front off-line** compilation, and are **static during decoding**. Kaldi's new grammar framework allows **multiple independent** grammars with nonterminals, to be compiled separately and **stitched together dynamically** at decode-time, but all the grammars are **always active** and capable of being recognized.\n\nThis project extends that to allow each grammar/rule to be **independently marked** as active/inactive **dynamically** on a **per-utterance** basis (set at the beginning of each utterance). Dragonfly is then capable of activating **only the appropriate grammars for the current environment**, resulting in increased accuracy due to fewer possible recognitions. Furthermore, the dictation grammar can be **shared** between all the command grammars, which can be **compiled quickly** without needing to include large-vocabulary dictation directly.\n\nSee the [Changelog](CHANGELOG.md) for the latest updates.\n\n### Features\n\n* **Binaries:** The Python package **includes all necessary binaries** for decoding on **Windows/Linux/MacOS**. Available on [PyPI](https://pypi.org/project/kaldi-active-grammar/#files).\n * Binaries are generated from my [fork of Kaldi](https://github.com/daanzu/kaldi-fork-active-grammar), which is only intended to be used by kaldi-active-grammar directly, and not as a stand-alone library.\n* **Pre-trained model:** A compatible **general English Kaldi nnet3 chain model** is trained on **~3000** hours of open audio. Available under [project releases](https://github.com/daanzu/kaldi-active-grammar/releases).\n * [**Model info and comparison**](docs/models.md)\n * Improved models are under development.\n* **Plain dictation:** Do you just want to recognize plain dictation? Seems kind of boring, but okay! There is an [**interface for plain dictation** (see below)](#plain-dictation-interface), using either your specified `HCLG.fst` file, or KaldiAG's included pre-trained dictation model.\n* **Dragonfly/Caster:** A compatible [**backend for Dragonfly**](https://github.com/daanzu/dragonfly/tree/kaldi/dragonfly/engines/backend_kaldi) is under development in the `kaldi` branch of my fork, and has been merged as of Dragonfly **v0.15.0**.\n * See its [documentation](https://dragonfly2.readthedocs.io/en/latest/kaldi_engine.html), try out a [demo](https://github.com/dictation-toolbox/dragonfly/blob/master/dragonfly/examples/kaldi_demo.py), or use the [loader](https://github.com/dictation-toolbox/dragonfly/blob/master/dragonfly/examples/kaldi_module_loader_plus.py) to run all normal dragonfly scripts.\n * You can try it out easily on Windows using a **simple no-install package**: see [Getting Started](#getting-started) below.\n * [Caster](https://github.com/dictation-toolbox/Caster) is supported as of KaldiAG **v0.6.0** and Dragonfly **v0.16.1**.\n* **Bootstrapped** since v0.2: development of KaldiAG is done entirely using KaldiAG.\n\n### Demo Video\n\n