Spelling Correction using Phonetics in E-commerce Search

Fan Yang, Alireza Bagheri Garakani, Yifei Teng, Yan Gao, Jia Liu, Jingyuan Deng, Yi Sun2022

Abstract: In E-commerce search, spelling correction plays an important role to find desired products for customers in processing user-typed search queries. However, resolving phonetic errors is a critical but overlooked area. The query with phonetic spelling errors tends to appear correct based on pronunciation but is nonetheless inaccurate in spelling (e.g., "bluetooth sound system" vs. "blutut sant sistam") with numerous noisy forms and sparse occurrences. In this work, we propose a generalized spelling correction system integrating phonetics to address phonetic errors in E-commerce search without additional latency cost. Using India (IN) E-commerce market for illustration, the experiment shows that our proposed phonetic solution significantly improves the F1 score by 9%+ and recall of phonetic errors by 8%+. This phonetic spelling correction system has been deployed to production, currently serving hundreds of millions of customers.

The Challenge of Phonetic Errors

In e-commerce, search is the primary gateway for customers to discover products. While traditional spell-checkers are highly effective at catching "fat-finger" typos (e.g., "iphnoe" for "iphone"), they often fail when a user writes how a word sounds—a phonetic error (e.g., "blutut" for "bluetooth").

Prevalence of phonetic errors across different e-commerce markets, highlighting the significance of brand and item-specific phonetic misspellings.

Traditional systems rely on Edit Distance (the number of character changes needed to transform one word into another). To maintain low latency, production systems typically limit this distance to 2. However, phonetic errors often have high edit distances; for instance, "blutut" and "bluetooth" have an edit distance of 4. Simply increasing the search radius would flood the system with irrelevant candidates and drastically increase latency. As shown in Figure 1, these errors are prevalent across various global markets, particularly affecting brand and item searches.

System Architecture

The researchers proposed a two-stage "generalized spelling correction" framework designed to handle these complex errors without sacrificing speed.

The two-stage generalized spelling correction framework, featuring hybrid candidate generation and candidate ranking.

1. Hybrid Candidate Generation

Instead of relying solely on character similarity, the system employs a Double Metaphone (DM) algorithm to encode tokens into phonetic keys. For example, the misspelled "blutut" might map to a phonetic key like PLTR. The system then retrieves candidates sharing that same phonetic key from a dictionary of actual product titles, ensuring that suggested corrections lead to real products in the catalog.

2. Candidate Ranking

After generating a list of potential corrections, the system selects the best match using XGBoost LambdaMART, a gradient-boosted decision tree model. A critical feature introduced here is "phonetic distance"—the edit distance between the phonetic keys of the query and the candidate. This provides a much stronger signal for the model than character-level distance alone. To maintain production-level speed, the system utilizes beam search to prune candidates early and employs caching to avoid redundant computations.

Evaluation and Impact

The system was evaluated using a human-annotated dataset of 30,000 query-correction pairs from Amazon’s India (IN) search logs. This market was selected due to its high volume of phonetic errors across multiple languages and brand terms.

Key Results: * Accuracy Gains: The phonetic solution improved the F1 score by over 9% and the recall of phonetic errors by over 8% compared to the baseline. * Latency Neutrality: By optimizing the beam search size, the researchers achieved these accuracy gains with flat or even slightly improved latency (TP99). * Search Relevance: In qualitative tests, a query like "blutut sant sistam" (bluetooth sound system) saw its relevant results jump from 82 (baseline) to over 9,000 (phonetic speller).

Conclusion

This work demonstrates that integrating phonetic encoding into both candidate generation and ranking stages significantly improves search relevance for e-commerce. By leveraging catalog-driven candidates and non-linear ranking models, the system effectively addresses "sounds-like" errors that traditional edit-distance methods miss. Currently deployed in production, this system serves hundreds of millions of customers, proving that phonetic awareness is essential for modern, global e-commerce search engines.

Summary updated

BibTeX
@misc{yang2022spelling,
  author = {Fan Yang and Alireza Bagheri Garakani and Yifei Teng and Yan Gao and Jia Liu and Jingyuan Deng and Yi Sun},
  title = {{Spelling Correction using Phonetics in E-commerce Search}},
  year = {2022},
  doi = {10.18653/v1/2022.ecnlp-1.9},
}
Figure