Custom Vocabulary for STT: Implementation and Optimization

Custom Vocabulary Implementation for STT Systems

AI Development Areas

Frequently Asked Questions

העבודות האחרונות

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1441
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1301
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    998
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1264
  • image_logo-advance_0.webp
    B2B Advance company logo design
    713
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1003

Custom Vocabulary Implementation for STT Systems

You integrate STT for a call center, but recognition of customer names and legal terms yields 40% errors. The model does not know "ОГРН", "СНИЛС", "ИНН". Every missed policy number or product code is lost data. Custom vocabulary is the fastest way to improve recognition of specific terms, names, and acronyms without retraining the model. It acts as a hint to the STT engine: "pay special attention to these words." Our certified engineers—over 8 years of experience and 30+ STT implementations—configure a vocabulary tailored to your domain in 2–4 hours. Word Error Rate reduction reaches 40% as early as the second day.

Why Custom Vocabulary Rather Than Model Retraining?

Retraining (fine-tuning) requires labeled audio data (at least 10 hours) and takes 2–4 weeks. Custom vocabulary delivers results in 1–2 days, reducing Word Error Rate by 30–50% for target terms. It does not change the architecture—you can modify the vocabulary on the fly without service downtime. For most business scenarios (order processing, legal consultations), this is sufficient.

Implementation for Major Providers

AWS Transcribe Custom Vocabulary

import boto3 transcribe = boto3.client('transcribe') # Create vocabulary from file (S3) transcribe.create_vocabulary( VocabularyName='corporate-terms-v1', LanguageCode='ru-RU', VocabularyFileUri='s3://my-bucket/vocabulary.txt' ) # Format of vocabulary.txt: # Phrase\tSoundsLike\tIPA\tDisplayAs # Б-Ф-И-О\tbeh ef ee oh\t\tБФИО # ИНН\tin en en\t\tИНН 

Azure Custom Speech

# Add domain adaptation data via Azure Portal or REST API # Supports: pronunciation dictionary, phrase list import requests phrase_list = { "kind": "PhraseList", "locale": "ru-RU", "phrases": ["ОГРН", "СНИЛС", "КПП", "расчётный счёт"] } 

Faster-whisper with Initial Prompt

model = WhisperModel("large-v3", device="cuda") # Initial prompt helps the model focus on relevant vocabulary initial_prompt = "ИНН, ОГРН, СНИЛС, КПП, расчётный счёт, генеральный директор." segments, _ = model.transcribe( audio, initial_prompt=initial_prompt, language="ru" ) 

The initial_prompt method works unreliably for long files—the prompt is processed only for the first window. For production, we recommend using the provider's built-in custom vocab.

Approach Comparison

Method Time to Implement WER Reduction Latency Overhead Maintenance Complexity
AWS Custom Vocabulary 1–2 days 30–50% 5–10% Low
Azure Phrase List 1–2 days 20–40% 5–10% Low
faster-whisper initial prompt 1 hour 10–20% 0% Medium (requires testing)
Model fine-tuning 2–4 weeks 50–70% 0% High

Custom vocabulary works 10x faster than model retraining and provides sufficient accuracy for 90% of tasks.

How We Reduce WER by 40% in 2 Days

The process includes auditing the current STT, designing a domain vocabulary, implementing via the chosen provider's API, and A/B testing on 100+ audio files. We use sound similarity (SoundsLike) for acronyms and pronunciation variants (IPA) for complex words. The result is measurable accuracy gain without infrastructure changes. For one insurance project, WER on terms "ДМС", "ВЗР", "ОМС" dropped from 55% to 12%.

What If the Vocabulary Doesn't Help?

Sometimes the custom vocabulary yields less than 10% improvement—a signal of deeper issues: poor audio quality, model not adapted to noise, or context overwhelmed by homonymy. In such cases, we recommend combining vocabulary with lightweight fine-tuning or data augmentation. We perform diagnostics and propose the optimal strategy.

Common Configuration Mistakes
  • Not specifying pronunciation variants for acronyms (e.g., "БФИО" recognized as "behfeeoh").
  • Overly long phrases (more than 10 words)—degrade performance.
  • Ignoring regional dialects—pronunciation may differ for accented Russian.
  • Lack of a test dataset—hard to tell if WER improved.

Setup Process

Stage Duration Result
Analysis 0.5 day List of 50–100 target terms
Design 0.5 day SoundsLike and IPA format
Integration 0.5 day Vocabulary connected to STT
Testing 0.5 day WER on a representative sample
Deployment 0.5 day Running in staging and production

Keeping the Vocabulary Up to Date

  • Versioning: every change is a new Git tag (v1.0, v1.1).
  • Automatic updates: CI/CD ingests new terms from Jira/spreadsheet.
  • Monitoring: alerts when accuracy drops by more than 5%.

A typical mistake is not accounting for homonyms. For example, "БФИО" may be recognized as "behfeeoh". In AWS Transcribe, the SoundsLike column is used for this.

Timeline: basic integration takes 1–2 days, including vocabulary population. We can evaluate your project within 2 days. Get a consultation on your case within 1 day—our engineers hold AWS AI and Azure AI Engineer certifications.

For detailed study, refer to the official documentation: AWS Transcribe Custom Vocabulary and Wikipedia: Speech recognition.