liveBook · Manning

Text augmentation

As explained in Deep Learning with R, Third Edition

Text augmentation is the creation of altered or generated textual training examples intended to improve a model's robustness or address data scarcity.

Text augmentation creates altered or generated training examples to improve robustness or address limited data. It can help with overfitting, but language is unusually sensitive to small changes. section 14.5.3

Word deletion and swapping

Randomly deleting or swapping words can transform “The rain in Spain falls mainly on the plain” into “The rain Spain falls plain on the mainly.” Training on such edits may improve robustness to typos and grammar mistakes. section 14.5.3

Treat text augmentation cautiously because edits can change meaning:

  • Word order is meaningful, so swapping two words can reverse a sentence’s meaning. section 14.5.3
  • Synonym replacement can select the wrong sense of a word and produce brittle examples. section 14.5.3
  • Seeking more naturally occurring text is usually preferable to investing heavily in augmentation techniques. section 14.5.3
  • Generative models offer a newer approach by producing consistent and coherent text. section 14.5.3

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains deletion, swapping, and synonym replacement with examples, then emphasizes semantic risks and practical limitations.
Examples
Uses random word deletion, word swapping, synonym replacement, and a sentence about rain in Spain.
What you can do after
Apply basic text edits while evaluating whether they preserve meaning and improve robustness.
How it connects
Connects text augmentation to data augmentation, word embeddings, pretraining, overfitting, and generative models.

Also explained in

Compare how 2 books explain text augmentation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.