Contextual Multilingual Spellchecker for User Queries

Sanat Sharma, Josep Valls-Vargas, Tracy Holloway King, Francois Guerin, Chirag Arora

TL;DR

This paper introduces a fast, multilingual spellchecker specifically designed for user search queries, which are often short and lack rich context. Their novel architecture and training approach significantly outperform existing solutions in accuracy and latency, making it suitable for production environments like Adobe's autocomplete features.

What Problem Does This Paper Address?

Spellchecking is a crucial feature for search engines, improving user experience by correcting typos. However, existing solutions often struggle with:

  • Accuracy vs. Speed: State-of-the-art models can be too slow for real-time search, while faster ones lack accuracy.
  • Multilingual Support: Most advanced models are English-centric and don't scale well to other languages.
  • Query Context: Spellchecking for short queries (1-2 words) is harder than for longer sentences because there's less contextual information to rely on.
  • Domain-Specific Vocabulary: Enterprises often have unique terms (e.g., product names) that off-the-shelf spellcheckers don't recognize.

This paper aims to bridge these gaps by creating a spellchecker that is fast, multilingual, context-aware (even for short queries), and adaptable to specific enterprise vocabularies.

Methods

The authors propose a two-module approach: a suggester and a ranker.

  • Suggester: They employ the Symmetric Delete algorithm. This algorithm is chosen for its extreme speed (around 1ms latency for up to 2 edit distances) and its language-agnostic nature. It pre-calculates an index of possible deletions, making runtime correction very efficient.
  • Ranker: A Neural Network (MLP) is used for ranking the suggestions. To overcome the limitations of MLPs in understanding token-level context, they feed a set of carefully engineered features for each suggestion. These features include:
  • Word Count: Frequency of the suggested word.
  • Asset Frequency: How often a word appears in search results (application-specific).
  • Download Count: For Adobe Stock, indicating query success.
  • Levenshtein Distance: Standard edit distance.
  • Language Locale & Application: Contextual information about where the query originated.
  • Phonetic Similarity: For words that sound alike but are spelled differently.

A key aspect of their architecture is a Behavioral Data Processing Pipeline that automatically updates these features based on user data, allowing the speller to adapt to new terms (like "covid" or "blockchain") without manual intervention. They also include a Multi-word Expression (MWE) module to handle common compound or decompounded errors specific to certain applications.

Datasets

The paper describes the creation and use of several datasets:

  • Artificially Generated Query Dataset: Created by injecting common spelling errors (letter order changes, vowel additions/removals, character substitutions, etc.) into real user queries extracted from Adobe Stock images across English, French, and German. This dataset is substantial, with millions of entries per language.
  • Birkbeck Corpus: A collection of misspellings from native English speakers, used as part of their English training data.
  • Commonly Misspelled Word Corpora: Mined from sources like Aspell and Wikipedia to identify relevant terms for their domain.
  • Adobe Express User Queries: A dataset used for evaluation, distinct from the training data, to test real-world performance. It includes English, German, and French queries, with a focus on product names.
  • Adobe Creative Cloud Home User Queries: Another evaluation dataset, comprising English queries from a single day, used for qualitative analysis.

Key Insights and Ideas

  • The Power of Simplicity for Speed: The choice of Symmetric Delete for the suggester highlights that for low-latency applications, a simpler, pre-computed approach can be more effective than complex runtime models.
  • Feature Engineering is Key for Neural Rankers: For short queries where token context is minimal, a well-curated set of features (beyond just the tokens themselves) is crucial for a neural ranker to perform well.
  • Adaptability is Paramount: The automatic updating of features via the behavioral pipeline is a significant innovation, allowing the spellchecker to stay relevant in dynamic enterprise environments without constant retraining.
  • Domain-Specific Tuning Matters: The paper demonstrates that tuning the spellchecker (e.g., by boosting product names) for specific applications leads to substantial improvements, underscoring the need for contextual signals beyond general language.

Key Results

  • Accuracy: The proposed spellchecker significantly outperforms off-the-shelf solutions like Aspell and even state-of-the-art neural models like NeuSpell on their custom datasets. For instance, on the Adobe Express query dataset, their model achieved 81.7% accuracy for English queries, compared to 51.6% for Aspell and 75.5% for NeuSpell.
  • Latency: The system achieves extremely low latency, averaging under 1ms per query, which is a fraction of the time taken by other models (e.g., 40+ ms for NeuSpell).
  • Multilingual Capability: The system is designed to be multilingual and is trained on English, French, and German data, with plans to expand to many more languages.
  • Production Readiness: The spellchecker is already in production for Adobe's autocomplete feature and is being integrated into Adobe Express and Adobe Stock.

Limitations and Future Work

  • Limitations: The paper notes that the suggester module can struggle with task-specific multi-word errors, which they address with an MWE module. While their MLP ranker is efficient, it doesn't inherently capture token-level understanding as well as recurrent or transformer models might, hence the reliance on feature engineering.
  • Future Work: The authors plan to:
  • Replace current production query-time spellers with their new system.
  • Expand the spellchecker to support approximately 10, and eventually 35, languages to cover primary search application languages.
  • Continue to leverage the same high-quality, custom-tuned, low-latency speller for both offline (autocomplete) and online (user queries) spell correction.

Summary updated

BibTeX
@misc{sharma2023contextual,
  author = {Sanat Sharma and Josep Valls-Vargas and Tracy Holloway King and Francois Guerin and Chirag Arora},
  title = {{Contextual Multilingual Spellchecker for User Queries}},
  year = {2023},
  eprint = {2305.01082},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.01082},
}
Figure