Skip to main content
QUICK REVIEW

[Paper Review] Contextual Text Denoising with Masked Language Models

Yifu Sun, Haoming Jiang|arXiv (Cornell University)|Oct 30, 2019
Topic ModelingComputer Science13 references6 citations
TL;DR

This paper proposes a contextual text denoising method using pre-trained masked language models (e.g., BERT) to correct noisy text without retraining or paired training data. By masking words and leveraging contextual predictions, the method improves downstream NLP performance on noisy inputs across translation, NLI, and paraphrase tasks, achieving significant BLEU and F1 score gains over baselines like spell-checkers.

ABSTRACT

Recently, with the help of deep learning models, significant advances have been made in different Natural Language Processing (NLP) tasks. Unfortunately, state-of-the-art models are vulnerable to noisy texts. We propose a new contextual text denoising algorithm based on the ready-to-use masked language model. The proposed algorithm does not require retraining of the model and can be integrated into any NLP system without additional training on paired cleaning training data. We evaluate our method under synthetic noise and natural noise and show that the proposed algorithm can use context information to correct noise text and improve the performance of noisy inputs in several downstream tasks.

Motivation & Objective

  • To address the vulnerability of state-of-the-art NLP models to noisy text inputs such as misspellings and typographical errors.
  • To develop a denoising method that leverages contextual information from pre-trained masked language models without requiring retraining or paired cleaning data.
  • To improve the robustness of NLP systems on both synthetic and natural noise in downstream tasks like machine translation, natural language inference, and paraphrase detection.
  • To evaluate whether the denoising method preserves performance on clean text, avoiding degradation from correction on already correct inputs.

Proposed method

  • The method processes each word in a sentence sequentially, masking it with a [MASK] token while preserving context from surrounding words.
  • For each masked word, the model generates a candidate list of potential corrections using the pre-trained masked language model (e.g., BERT), which predicts the masked token based on left and right context.
  • The number of masked tokens per word is varied (empirically set to N=4) to generate multiple masked sentence variants, increasing the likelihood of capturing the correct word.
  • Text augmentation is applied by concatenating the original noisy sentence with each masked variant to improve candidate quality and context awareness.
  • The final correction is selected from the candidate list using a rule based on edit distance to the original noisy word, favoring candidates close to the input spelling.
  • The method is applied in a left-to-right order, skipping punctuation and numbers, and is compatible with any NLP system without model fine-tuning.

Experimental results

Research questions

  • RQ1Can a pre-trained masked language model effectively recover noisy text using only contextual information, without retraining or labeled data?
  • RQ2How does the proposed denoising method compare to rule-based spell-checkers in improving downstream NLP task performance on noisy inputs?
  • RQ3Does applying the denoising algorithm to clean text degrade its performance, indicating robustness to over-correction?
  • RQ4To what extent can the method improve performance on both synthetic and natural noise in diverse NLP tasks?

Key findings

  • On the IWSLT 2014 English-to-German translation task, the proposed method improved BLEU scores from 22.27 (artificial noise) and 17.29 (natural noise) to 25.80 and 21.40, respectively, when applied to a fairseq Transformer model.
  • For Google Translate, the method improved BLEU scores from 28.11 (artificial noise) and 25.22 (natural noise) to 28.96 and 25.49, respectively.
  • On the SNLI NLI task, the method improved accuracy from 75.0 (artificial noise) and 74.0 (natural noise) to 81.0 and 77.0, respectively, while maintaining near-original performance (83.0) on clean text.
  • On the MRPC paraphrase detection task, the method improved F1 scores from 81.9 (artificial noise) and 75.2 (natural noise) to 82.7 and 76.4, respectively, outperforming both the original model and spell-checker baselines.
  • The method showed minimal degradation on clean inputs, with only a 1.0-point drop in SNLI accuracy (from 84.0 to 83.0) when applied to original sentences, indicating robustness to over-correction.
  • The use of text augmentation and candidate list filtering with edit distance significantly improved correction accuracy compared to baseline spell-checkers, which often reduced performance on noisy inputs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.