Spelling Correction using Phonetics in E -commerce Search (2022)

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 much 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.

## introduction search is critical to provide a great customer shopping experience in e-commerce. usually, as the first step of the search workflow, spelling correction is responsible to reduce the irrelevant and sparse search results caused by spelling errors in search keywords. in addition, low latency is required considering spelling correction is only part of many modules in the search workflow. despite the large amount of research on correcting spelling errors @xcite , addressing phonetic errors is an important, but overlooked area. phonetic spelling error typically happens when the query has similar pronunciation but is nonetheless inaccurate in spelling (e.g., "bluetooth sound system" vs. "blutut sant sistam" in english). figure 1 describes the phonetic error percentage of misspelled queries based on a human annotated spelling correction dataset sampled from the amazon search query log. we find that this type of spelling error dominates in multiple e-commerce markets with various languages, existing mostly on generic item terms (e.g., "nacklesh" vs. "necklace") and brand terms (e.g., "scalkendy" vs. "skullcandy"). this issue might damage customer trust and present greater challenges when e-commerce offers more products (i.e., brand names) with sensational spelling (e.g., hasbro's playskool @xcite ) and attracts customers with low written proficiency. however, the traditional spelling correction system is not able to address phonetic spelling errors well because it usually searches the correction of given spelling errors up to a certain edit distance @xcite @xcite , while phonetic spelling errors could lead to large edit distance with variously noisy forms (e.g., editdist("blutut" vs. "bluetooth")=4). there exists multiple attempts to address phonetic errors by generating soundslike equivalent candidates based on phonetic algorithms @xcite . although soundslike equivalent candidates may handle phonetic errors better, they tend to be too noisy to cover the correct spelling of non-phonetic errors in a limited size satisfying low latency requirements (shown in section 3). to address these limitations, we propose a generalized spelling correction system that enables us to integrate phonetics into e-commerce search without additional latency cost. it includes a new hybrid candidate generation method with phonetic mapping as well as an effective candidate ranking method leveraging phonetic signals. in particular, our major contributions include: (1) we propose an effective hybrid candidate generation method, which aims to capture the complementary candidates across edit distance and soundslike based methods to address both phonetic and nonphonetic spelling errors; (2) we propose a flexible candidate ranking stage by leveraging phonetic signals, which tends to rank the correct spelling of phonetic errors to the top; (3) our offline study shows a 9%+ speller overall improvement with an 8% improvement on phonetic errors without additional latency cost by incorporating phonetics into our generalized spelling correction system. to the best of our knowledge, this work is the first to propose an efficient and effective phonetic solution with ablation study in e-commerce search, and this phonetic solution can be easily applied to any automatic spelling correction system with candidate generation or ranking stage. ## problem formulation and modeling in this section, we formally define our generalized spelling correction structure using phonetics. most current search engines detect and correct spelling errors automatically. one of the most popular structures defined by @xcite includes candidate generation and candidate ranking steps based on the noisy channel model (ncm) @xcite . the basic idea of ncm is to find the spelling correction c * given the input query q and its spelling correction candidates @xmath0. . . c n via the bayes' rule: ## experiments in this section, we formally evaluate our proposed spelling correction system integrating phonetics. we use in e-commerce market for illustration. we train and evaluate the candidate ranker based on the human annotated dataset with 30000 querycorrection pairs from the search query log. we split 33.33% for training, validating, and testing. the evaluation metric is the f1 score, which is a harmonic mean of the precision and recall. precision represents the speller's accuracy rate when its action is auto-correction, while recall is defined as the speller's accuracy rate for misspelled queries. we also report the recall of queries with phonetic errors and top percentile (tp) 99 latency of the spelling correction system in milliseconds. we treat the top 1 candidate as the correction of a given input query with auto-correction action when the top 1 candidate is different from the input query, although the system supports more complicated classifiers after the ranking stage. relative impacts (instead of absolute values) are reported for legal requirements. we first conduct an ablation study for the candidate ranking module. we apply a standard setting in the candidate generation step that allows 20 edit distance based token candidates with allowed maximum edit distance 2 and beam search size 12. typical ranking features based on different types of language and error models are included, and we focus on the impact of the phonetic distance feature. the phonetic distance feature contributes to 3%+ f1 and 2%+ phonetic error recall improvement @xcite to row @xcite ). this supports our motivation that the phonetic distance feature tends to rank the correct candidate of a phonetically misspelled query higher, improving both the overall f1 score and recall of phonetic errors. adopting xgboost lambdamart algorithm with phonetic distance feature in the candidate ranking stage, we evaluate the hybrid candidate generation performance in a performance regression on both f1 and phonetic error recall. furthermore, enlarging the phonetic mapping (row @xcite ) is not an optimal solution considering its worse performance than hybrid sources (row @xcite ). then, we select the beam search size (row @xcite ) to control the similar tp99 for best f1 and phonetic error recall, compared with baseline (row [i]). the setting in row @xcite achieves 6%+ f1 score and 5%+ phonetic error recall improvement with flat latency. aggregating the phonetic feature's impact (compare row @xcite in ## conclusions and future work in this work, we developed a generalized spelling correction system integrating phonetics into both hybrid candidate generation and candidate ranking stages on e-commerce domain. we demonstrated that our proposed phonetic solution improves more than 9% on f1 score and 8% on recall of phonetic errors without additional latency cost. this solution can be applied to any automatic spelling correction system with candidate generation or ranking stage. online a/b testing showed positive business metrics while reducing sparse/irrelevant search results. future directions include applying similar phonetic integrating ideas to other spelling correction frameworks (jayanthi et al., 2020