Hotword Boosting Implementation for STT

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1 servicesAll 1566 services
Hotword Boosting Implementation for STT
Simple
from 1 business day to 3 business days
FAQ
AI Development Areas
AI Solution Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822

Hotword Boosting Implementation for STT Hotword Boosting is a mechanism for increasing the recognition probability of specific words and phrases. Unlike a custom vocabulary (a static list), hotword boosting is applied dynamically at runtime—different phrases for different query contexts. ### Implementation for different providers Google STT with phrase boost:

from google.cloud import speech

def transcribe_with_hotwords(audio_content: bytes, hotwords: list[str]) -> str:
    client = speech.SpeechClient()

    speech_contexts = [
        speech.SpeechContext(
            phrases=hotwords,
            boost=20.0  # max значение
        )
    ]
    config = speech.RecognitionConfig(
        encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16,
        sample_rate_hertz=16000,
        language_code="ru-RU",
        speech_contexts=speech_contexts,
        enable_automatic_punctuation=True,
    )
    response = client.recognize(config=config,
                                 audio=speech.RecognitionAudio(content=audio_content))
    return response.results[0].alternatives[0].transcript
```**Vosk with grammar (FST-based boosting)**:```python
from vosk import Model, KaldiRecognizer
import json

model = Model("vosk-model-ru-0.42")

# Ограниченная грамматика для определённого контекста
grammar = json.dumps(["да", "нет", "отмена", "помощь", "[unk]"])
recognizer = KaldiRecognizer(model, 16000, grammar)
```**Whisper via prefix prompt** is unreliable, but works for short recordings with specific expectations. ### Dynamic hotwords In voice bots, hotwords depend on the state of the conversation:```python
DIALOG_HOTWORDS = {
    "greeting": ["здравствуйте", "добрый день", "привет"],
    "payment": ["оплатить", "счёт", "карта", "перевод", "сумма"],
    "cancel": ["отменить", "назад", "стоп", "выход"],
}

def get_hotwords_for_state(state: str) -> list[str]:
    return DIALOG_HOTWORDS.get(state, [])
```Timeframe: integration into existing STT – 1–2 days.