Why Word Error Rate Is Not Enough: Semantic Decomposition of ASR Errors
From the publisher’s feed, collected in the ZeroLabs newsroom.
A feasible framework for evaluating ASR models across semantic categories instead of a single aggregate metricImage generated by author using ChatGPTIntroductionIn products built on top of Automatic Speech Recognition (ASR) models, speech recognition quality directly affects the user experience.This article analyzes methods for evaluating ASR model quality, the limitations of standard evaluation approaches, and how we measure recognition quality in our environment.Business Value and Problem DefinitionTo simplify, the primary use case in our product is the generation of automatic speech transcriptions for users. Accordingly, the more accurately a model processes speech, the more accurate the resulting text becomes.As a result, ASR is a key part of the product, and transcription quality metrics act as key proxy metrics:A basic health check — models can degrade over time, and it is important to detect this early.The ability to conduct market reviews and select more accurate models.The ability to optimize costs by choosing less expensive models with comparable quality.How Is Speech Recognition Quality Measured?Word Error Rate (WER)Word Error Rate (WER) measures the proportion of word-level errors in a transcription.WER is based on Levenshtein distance, an algorithm used to measure the difference between two sequences. In the context of ASR, these sequences are:The transcription generated by the speech recognition system (the hypothesis).the actual spoken text (the reference transcription).WER is calculated by counting the number of transformations required to convert the hypothesis into the reference transcription:insertions.deletions.substitutions.Character Error Rate (CER)Character Error Rate (CER) is a similar metric calculated at the character level rather than the word level.In this article, we will focus exclusively on WER, since CER is not used in our evaluation framework.In many cases, it is possible to rely on benchmarks published by model developers themselves. For example, below are results across different languages for one of the most widely used ASR models, Whisper by OpenAI.Figure 1. Distribution of WER and CER (shown in italics) across languages for Whisper AI | image from GitHubLimitations of the Industry StandardDespite its broad adoption, the standard approach has several important limitations:It produces only a single aggregated WER value, which is often insufficient for decision-making.Different models are evaluated on different datasets, making comparisons unreliable.There is no detailed breakdown showing where the model actually makes mistakes.As a result, WER without further decomposition can be misleading.Why Does This Matter?To understand the limitations of WER, let us look at the formula itself:where:S — number of substitutions.D — number of deletions.I — number of insertions.N — number of words in the reference transcription.As we can see, the formula only considers the total number of transformations, broken down into substitutions, deletions, and insertions.Let us consider a simple example.Two models have the same WER = 10%.Model 12% errors in common vocabulary.8% errors in named entities (proper names, organizations, locations, etc.).Model 28% errors in common vocabulary.2% errors in named entities.Figure 2. Comparison of error structures with identical overall WER | image by authorThis perspective provides a much more accurate view of quality.At the overall WER level, both models appear identical. However, the error distribution reveals fundamentally different behavior. When scaled to hundreds of hours of speech and hundreds of thousands of words, the impact on users — and consequently on the product itself — can be enormous.The Problem in Our CaseHistorically, our product relied on a single ASR model that appeared acceptable.However, users consistently complained about transcription quality. After conducting a high-level analysis of transcripts and recognition errors, we hypothesized that mistakes occurred most frequently in named entities (proper names and similar terms). Moreover, these errors appeared to be the most critical from the users' perspective.To verify this hypothesis, we decided to evaluate quality using our own data and extend the standard evaluation approach.How We Measure Model Accuracy InternallyEvaluation Across Semantic CategoriesWe do not limit ourselves to a single WER value.Instead, we use an extended framework that evaluates errors across semantic categories:Common vocabulary.Named entities:- Person names.- Organizations.- Geographic entities.- Events.- Dates and time expressions.ProcessTo move beyond overall WER and introduce semantic-category-based analysis, we had to solve several key tasks.Task 1: Building a Reliable Dataset and Ensuring Comparable ResultsTo compare models fairly, we use a single reference dataset. That is important because differences in data, audio quality, and annotation quality can significantly distort evaluation results.Statistical Significance of the DatasetThe first challenge is to ensure that differences in WER are statistically significant rather than random noise.Since WER is calculated at the word level, the dataset size is defined as the minimum number of words required to achieve statistically meaningful measurements.However, there is an important consideration.Our goal is not only to measure overall WER but also to evaluate the quality of named-entity recognition. Therefore, the required sample size n must account for the proportion of named entities in the corpus.As a result, the dataset size is further scaled based on the proportion of named entities in the data.For our calculations, we use the following statistical requirements:Confidence level: 95%.Margin of error: ±1%.The required number of words is calculated using the following formula:where:n — number of words in the transcription.Z ≈ 1.96 (for a 95% confidence level).p — error probability used for estimating the minimum sample size.As a conservative assumption, we use p = 50%, because the expression p(1-p) reaches its maximum value when p = 0.5. This corresponds to the maximum variance and provides the safest (largest) estimate of the required sample size, regardless of the quality of the evaluated model.E — required precision (±1%).ShareNE — an additional coefficient used to ensure statistical significance for named-entity-level analysis. It is calculated as the inverse of the named-entity share in the corpus.For instance, if named entities account for 15.5% of the text, a standard sample size calculation may not provide enough statistically significant data for entity-level analysis. Therefore, the sample size is scaled proportionally: 1/0.155 ≈ 6.45.Task 2: Determining Where an Error Occurs and Which Category It Belongs ToWithout understanding where an error occurs and which semantic category it belongs to, the rest of the framework becomes impossible.To solve this problem, we add a preprocessing step when building the dataset.We enrich the reference transcription with metadata by creating named-entity annotations via Named Entity Recognition.Named Entity Recognition (NER)Named Entity Recognition (NER) is an NLP technique that automatically identifies key entities in text and classifies them into categories such as people, organizations, locations, dates, monetary values, and many others.As part of this annotation process, each word receives a semantic category tag. This allows us to analyze WER not only at the overall level but also separately for different entity types.Entity ClassificationWe use the following classification scheme:Common Vocabulary (GENERAL)Named Entities (NE):- PERSON — names of people.- ORG — organization names.- GPE — countries, regions, and geographical entities.- EVENT — named events (for example, G7 Summit).- DATE/TIME — dates and time expressions.Annotation ToolsTo generate annotations, we use NER models and libraries such as spaCy and Hugging Face Transformers, built on the mBERT architecture. These tools allow us to automate the annotation process.In this article, I do not go into the implementation details of NER because it is a complex topic in its own right. For readers interested in the underlying mechanics, I recommend exploring the subject separately.At a high level, the workflow is straightforward:The reference transcription is fed into the NER model.The model processes the text.The model returns:- entity positions.- entity categories.Example of Named Entity AnnotationReference text:On March 12, 2024, representatives from Greenfield Energy met with officials from the City Council of Brighton to discuss a new urban sustainability initiative. The project, called «Clean Streets Program,» is expected to launch in June 2024 and will initially cover several districts in southern England. According to project lead Anna Carter, the initiative aims to reduce emissions and improve waste management efficiency across the region.Table 1. Example of named entity annotation in a reference transcriptionTask 3: Combining Errors and SemanticsAt this stage, we already have a fully prepared dataset consisting of:a reference transcription.named entity annotations.However, we still do not know how to associate recognition errors with specific entities.To solve this problem, we need to combine standard WER transformations (substitutions, deletions, and insertions) with semantic annotations.Using jiwer for WER AlignmentTo calculate the underlying WER transformations, we use the Python library jiwer, which compares the reference transcription and the hypothesis using the Levenshtein (edit) distance.The library automates the process by performing text normalization, tokenization, and sequence alignment. And then calculating the number of operations required to transform the hypothesis into the reference transcription — insertions, deletions, substitutions.Because entity tags exist only in the reference transcription while recognition errors occur in the hypothesis, we must align errors and their positions with the corresponding entity annotations.This alignment step provides the foundation for semantic error analysis.From Basic WER Operations to Semantic Error CategoriesAfter alignment, the standard WER operations (S, D, and I) can be decomposed into semantic categories.S — total substitutions:- S_GENERAL, S_PERSON, S_ORG, S_GPE, S_EVENT, S_DATE/TIME — number of substitutions, broken down by semantic categories.D — total deletions:- D_GENERAL, D_PERSON, D_ORG, D_GPE, D_EVENT, D_DATE/TIME — number of deletions, broken down by semantic categories.I — total insertions:- I_GENERAL, I_PERSON, I_ORG, I_GPE, I_EVENT, I_DATE/TIME — number of insertions, separately broken down by semantic categories.For example:Reference transcription: Anna Carter met officials.Hypothesis: Anna Cartel met officials.The jiwer alignment identifies:S — substitution (Carter → Cartel).Since the token Carter is annotated as PERSON, the error is also classified as S_PERSON.After processing the entire dataset, we aggregate errors by category and calculate the corresponding metrics.Figure 3. Example of jiwer alignment | image by authorTask 4: Calculations and Result InterpretationModel SetNow we can move to the final stage: calculating metrics and interpreting the results.For simplicity, I will present only a subset of the data and models that were evaluated. The goal is not to provide a comprehensive benchmark but rather to demonstrate the overall methodology and decision-making process.In our case, we evaluated four ASR models:Model A — the default model originally used in the product.Models B, C, and D — alternative ASR models.Named Entity DensityBecause our content contains a relatively high density of named entities — primarily news broadcasts, political content, and similar information-rich sources — it is important to consider these entities separately.After annotating the dataset, we obtained the following semantic category distribution:Table 2. Distribution of semantic categories in the reference datasetNamed entities account for 15.5% of all tokens in the dataset, which is an important factor when interpreting the results.Overall WERIn the table below, I have provided data on measurements of the standard WER. For now, I deliberately do this without semantic decomposition.Table 3. Overall WER and basic error types across ASR models | image by authorBased solely on these results, we would conclude that Model C is the best choice because it achieves the lowest overall WER.However, this is precisely where semantic decomposition becomes valuable.It allows us to look beyond the aggregate metric and understand the actual structure of model errors.Errors Across Semantic CategoriesNow I introduce the concept of WER_i—the WER metric for each semantic category. It is WER on subset i, where i are semantic categories (GENERAL, PERSON, etc.). It shows how often the model is wrong within each category:Table 4. Recognition errors across semantic categoriesKey ObservationsWhen analyzing errors by semantic category, there is an interesting pattern.The default model misrecognizes approximately:15% of common vocabulary tokensHowever, for named entities:nearly 30% of tokens are recognized incorrectlyIt means that roughly one in three named entities is transcribed incorrectly.At the same time, the best-performing model specifically for named entities is Model D, with an error rate of only 7%.This remains true even though Model D does not achieve the best overall WER:Model D — 8%Model C — 7%From a business perspective, Model D is therefore the more attractive choice because it performs better in the scenarios that matter most to users.Figure 4. Comparison of WER across key semantic categories | image by authorContribution of Each Error Category to Overall WERI also introduce another metric: the ratio of errors belonging to semantic category i relative to the total number of errors.This metric shows how much each category contributes to the overall WER.Table 5. Contribution of semantic categories to overall WERDespite accounting for only 15% of all tokens, named entities contribute:27% of the total WER for the default model.This strongly supports the idea that improving named entity recognition can generate disproportionate value.For example, in Model D, which delivers the strongest performance on named entities, the contribution of named-entity errors drops to 13.5%.Figure 5. Contribution of semantic categories to overall WER across models | image by authorLimitationsResults depend on NER annotation quality.Different NER models may produce slightly different category boundaries.The framework is most useful for domains where named entities carry high business value.The approach increases evaluation complexity compared to standard WER.Final ConclusionThe analysis shows that although Model C achieves the lowest overall WER, a significant portion of its remaining errors is still concentrated in named entities.Model D shows a more balanced error distribution and significantly lower error rates in important categories such as PERSON, despite having a slightly higher overall WER.This suggests that:Model C optimizes overall transcription quality.Model D preserves semantically important information more effectively.As a result, Model D was selected as the optimal production model and replaced Model A.In scenarios where different types of errors have different business value — for example, errors in named entities versus errors in common vocabulary — an aggregated metric can conceal critical differences between models.A low overall WER does not necessarily mean that a model performs best where it matters most.Another important benefit of this approach is that it enables much more targeted post-processing on top of the ASR model itself.Rather than modifying the underlying model, we can improve quality by adding additional layers of logic and corrections.In our specific case, this approach enabled the development of:custom dictionaries.automatic replacements.additional post-processing techniques.Related WorkAfter completing most of this work, I came across the research «Named Entity Extraction from Speech» by Francis Kubala, Richard Schwartz, Rebecca Stone, and Ralph Weischedel (1998).The article explores the relationship between speech recognition accuracy and named entity extraction, highlighting that evaluating ASR systems solely through aggregate recognition metrics may not always reflect their effectiveness in downstream tasks.Although the technological landscape has changed dramatically since then — from statistical speech recognition systems to modern transformer-based ASR models — the underlying challenge remains relevant. In many real-world applications, not all recognition errors have the same impact on users or business outcomes.The approach presented in the article examines the problem from the practical perspective of the production process: it involves decomposing the WER metric by semantic categories and analyzing exactly where recognition errors occur.P. S.I'm interested in discussing ASR quality evaluation, NLP, and product applications of machine learning. Feel free to connect with me on LinkedIn.ResourcesWord error rate - WikipediaLevenshtein distance - WikipediaGitHub - openai/whisper: Robust Speech Recognition via Large-Scale Weak SupervisionNamed-entity recognition - WikipediaspaCy · Industrial-strength Natural Language Processing in PythonHugging Face - The AI community building the future.BERT-base-multilingual-casedjiwerhttps://www.researchgate.net/publication/2347872_Named_Entity_Extraction_From_SpeechWhy Word Error Rate Is Not Enough: Semantic Decomposition of ASR Errors was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.