Abstract
Embodiments of the present invention relate to a customizable text normalization framework providing for domain adaptability through modular replacement generators. In one embodiment, a method of and computer program product for text normalization are provided. An input sequence comprising a plurality of tokens is received. A plurality of generators is applied to the input sequence to generate a set of candidate replacements of the tokens of the sequence. A plurality of subsets of the set of candidate replacements is determined such that the candidate replacements of each subset are syntactically consistent. A probability is determined for each of the subsets. A subset of the plurality of subsets having the highest probability is selected. Each candidate replacement of the selected subset is applied to the input sequence to generate an output sequence. The output sequence is outputted.
Introduction
Natural Language Processing (NLP) tools, particularly dependency parsers, are typically trained on formal, grammatically correct text such as the Wall Street Journal. When these tools are applied to informal text—such as tweets, SMS messages, or customer service chat logs—their performance degrades significantly.
Historically, text normalization has been treated as a word-to-word translation task (e.g., mapping "ur" to "your"). However, parsers rely heavily on structural cues like punctuation, capitalization, and word order, which simple word-to-word normalizers ignore. Furthermore, existing normalizers are often hardcoded to specific domains and evaluated using metrics like Word Error Rate (WER), which do not necessarily correlate with downstream parser performance. This work introduces a domain-adaptable normalizer that explicitly aims to produce fully grammatical sentences to maximize parser utility.
Methodology
The proposed framework utilizes a log-linear model over a directed acyclic graph (DAG). The architecture is highly modular and operates in three distinct phases:
- Replacement Generators: The system employs a collection of independent "generators" that act as black boxes. These range from generic rules (spell checkers, capitalization, punctuation insertion) to domain-specific dictionaries (SMS slang, Twitter-specific regex). These generators propose a set of overlapping candidate edits for an input sentence.
- Graph Construction: A DAG is constructed where nodes represent proposed replacements. Edges connect nodes that are "locally consistent," meaning they do not propose conflicting edits for the same segment of the original string.
- Inference: Edges are weighted using a log-linear model incorporating features such as N-gram frequencies, POS tags, and generator lineage. The optimal normalized sentence is identified by finding the weighted longest path from the
startnode to theendnode.
The model is trained using a perceptron-style algorithm that updates weights by comparing the predicted longest path against a gold-standard path.
Evaluation and Datasets
The system was evaluated across three domains: Twitter (Han and Baldwin dataset), SMS ("Treasure My Text" dataset), and a new dataset of Call-Center logs. To support parser-centric evaluation, the authors manually re-annotated the Twitter and SMS datasets to enforce full grammaticality, including punctuation and word reordering.
Instead of standard translation metrics, the study uses a direct downstream evaluation: running the Stanford Parser on the normalized output and measuring the Precision, Recall, and F1 scores of extracted Subjects, Verbs, and Objects (SVO).
Key Results
The normalization framework improved absolute parsing performance by 18% to 25% on subject and object extraction compared to parsing raw text. A significant finding was that the automated system outperformed perfect, manual gold-standard word-to-word annotations. This demonstrates that structural fixes (like punctuation) are often more critical for parsers than simple spelling corrections.
On the Twitter dataset, the domain-specific model achieved a 91.9% F1 score on Verb extraction and 74.4% F1 on Subject-Object extraction, significantly higher than the manual word-to-word baseline (Gw2w) which reached only 86.7% and 53.0%, respectively. Similarly, on the Call-Center dataset, domain-specific generators boosted Subject-Object extraction F1 from 67.6% (no normalization) to 85.4%.
Conclusion
This framework proves that parser-centric normalization is superior to traditional word-to-word approaches for downstream NLP tasks. While the model excels at modular adaptation, challenges remain in handling complex word reordering and the "chicken-and-egg" problem of punctuation insertion, where deep syntactic understanding is required to place markers that the parser itself needs to function. Future research will focus on identifying which specific normalization tasks provide the highest marginal gains for parser accuracy.
Summary updated