Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Description

This is an OpenVoiceOS STT plugin. It combines Whisper-LM-transformers, KenLM, and large language models with Whisper ASR models from the Hugging Face library.

Install

pip install ovos-stt-plugin-whisper-lm

⚠️ Only python <=3.11 is supported by some of the dependencies.

Models

HiTZ provides pretrained n-gram models.

Each lm_model is built with the KenLM toolkit. It is based on n-gram statistics from large, domain-specific corpora. The available models are:

  • Basque (eu): 5gram-eu.bin (11G)
  • Galician (gl): 5gram-gl.bin (8.4G)
  • Catalan (ca): 5gram-ca.bin (20G)
  • Spanish (es): 5gram-es.bin (13G)

Xabier Zuazo also provides finetuned Whisper models for these languages.

Instead of an n-gram model, you can use a large language model such as Latxa.

Configuration

The example below uses the HiTZ Basque KenLM model. Adjust lm_alpha, lm_beta, and the other parameters to get the best results with your own models.

  "stt": {
    "module": "ovos-stt-plugin-whisper-lm",
    "ovos-stt-plugin-whisper-lm": {
        "model": "zuazo/whisper-medium-eu",
        "lm_repo": "HiTZ/whisper-lm-ngrams",
        "lm_model": "5gram-eu.bin",
        "lm_alpha": 0.33582369,
        "lm_beta": 0.68825565,
        "use_cuda": true
    }
  }

💡 Set lm_repo only if you want to specify a specific filename in lm_model.

To use a large language model instead of an n-gram model:

  "stt": {
    "module": "ovos-stt-plugin-whisper-lm",
    "ovos-stt-plugin-whisper-lm": {
        "model": "zuazo/whisper-medium-eu",
        "lm_model": "HiTZ/latxa-7b-v1.2",
        "lm_alpha": 2.73329396,
        "lm_beta": 0.00178595,
        "use_cuda": true
    }
  }

⚠️ Running large language models next to Whisper needs enough GPU memory.

Credits

TigreGotico developed this plugin for OpenVoiceOS under the ILENIA project.

The Ministerio para la Transformación Digital y de la Función Pública funded this plugin, and the Plan de Recuperación, Transformación y Resiliencia funded it through NextGenerationEU, within the ILENIA project, reference 2022/TL22/00215337.

The Creative Commons Attribution 4.0 International License (CC BY 4.0) covers the pretrained n-gram models. You may use, modify, and distribute these models if you credit the original creators.

@misc{dezuazo2025whisperlmimprovingasrmodels,
      title={Whisper-LM: Improving ASR Models with Language Models for Low-Resource Languages}, 
      author={Xabier de Zuazo and Eva Navas and Ibon Saratxaga and Inma Hernáez Rioja},
      year={2025},
      eprint={2503.23542},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2503.23542}, 
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_stt_plugin_whisper_lm-0.0.6a11.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file ovos_stt_plugin_whisper_lm-0.0.6a11.tar.gz.

File metadata

File hashes

Hashes for ovos_stt_plugin_whisper_lm-0.0.6a11.tar.gz
Algorithm Hash digest
SHA256 5b60d2ac6e5f4ca65592dccffc5d31f53926e3a4d6b03b0458cfbf6a3eb0afa2
MD5 5447394fe2e7432e14020ed26ae5daba
BLAKE2b-256 eaa3f2e4d15c31835afeb1183a97938a0e28a07bce40f4c3d20a5e26ee4d1106

See more details on using hashes here.

File details

Details for the file ovos_stt_plugin_whisper_lm-0.0.6a11-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_stt_plugin_whisper_lm-0.0.6a11-py3-none-any.whl
Algorithm Hash digest
SHA256 409896e6eb913571216db6b500132e86aadf46ebe2a42069d6ccb8cccee0732f
MD5 0b2152f5c62b6c918ee3bff76d2702d9
BLAKE2b-256 7d09b4d868866648f8bbd1d973f7f53f2fe61ca55bbb4c7ee455d990e28c0332

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page