A Fast Randomized Algorithm for Massive Text Normalization

Nan Jiang, Chen Luo, Vihan Lakshman, Yesh Dattatreya, Yexiang XuearXiv 2021

Introduction

Real-world text data—from social media threads to e-commerce search logs—is notoriously "noisy," filled with typos, slang, and non-standard punctuation (e.g., "goooood" vs. "good"). While modern NLP models perform exceptionally well on clean text, their performance often degrades significantly when faced with this noise.

Existing solutions for lexical normalization—the process of converting noisy tokens to their canonical forms—face a scalability wall. Traditional edit-distance algorithms are computationally expensive when applied to billions of lines of text, and supervised learning approaches require massive amounts of labeled data that are expensive to produce and domain-specific. FLAN (Fast Lexical Normalization) is introduced as a fast, unsupervised, and robust method suitable for web-scale datasets.

Methodology

FLAN treats normalization as a similarity search problem solved through randomized hashing. The process involves several key stages:

1. Jaccard Similarity and Hashing

Instead of semantic meaning, FLAN focuses on morphology. It breaks words into character n-grams and uses Jaccard similarity to determine structural overlap. To avoid the quadratic complexity of comparing every word pair, FLAN employs Locality-Sensitive Hashing (LSH) via MinHash. This allows the algorithm to "bucket" similar-looking words together in sub-linear time.

The FLAN hashing process for generating word signatures from sub-strings.

2. Graph Stabilization and Edge Pruning

Because LSH is randomized, dissimilar words can occasionally collide. FLAN addresses this by repeating the hashing process multiple times to build a weighted word-to-word graph. Edges between words are only preserved if they appear together in a minimum number of hashing repetitions, controlled by a threshold parameter $\alpha$. This stabilization step effectively filters out random noise and ensures that only robustly similar words are grouped.

3. Canonicalization

Once the graph is stabilized, connected components represent groups of similar words. The most frequent word in each group is selected as the "representative" or pivot (e.g., "good" becomes the pivot for "goood" and "gooood").

Evaluation and Results

The researchers evaluated FLAN across several massive datasets, including 1.6 million tweets from Sentiment140, 10 million sentences from Reddit, and an industrial dataset of 100 million lines of e-commerce search logs.

Performance and Scalability

In the industrial setting, FLAN completed normalization in roughly 4 hours, whereas traditional edit-distance methods were projected to take days. On Twitter data, FLAN's indexing was over 10x faster than popular baselines.

Quality and Robustness

Human evaluators found that FLAN achieved a 5% and 14% higher F1-score on Reddit and Twitter datasets, respectively, compared to competing methods. Furthermore, using FLAN as a preprocessing step consistently boosted performance on the GLUE benchmark when text was perturbed with synthetic noise.

Performance of FLAN compared to baselines across different threshold values for Twitter and Reddit.

The sensitivity analysis shows that FLAN's performance is robust across a range of threshold values, eventually outperforming baselines like Norvig's spellchecker and FAISS-based embeddings as the graph stabilizes.

Conclusion

FLAN provides a scalable, unsupervised solution for massive text normalization. By combining the efficiency of LSH with a novel graph-stabilization technique, it bridges the gap between computational feasibility and canonicalization quality. While currently context-agnostic, future iterations aim to incorporate surrounding word information to further improve disambiguation in complex linguistic scenarios.

Summary updated

BibTeX
@misc{jiang2021fast,
  author = {Nan Jiang and Chen Luo and Vihan Lakshman and Yesh Dattatreya and Yexiang Xue},
  title = {{A Fast Randomized Algorithm for Massive Text Normalization}},
  year = {2021},
  eprint = {2110.03024},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.03024},
}
Figure