liveBook · Manning

Text augmentation

As explained in Deep Learning with Python, Third Edition

A family of methods that create modified text examples to improve model robustness.

Text augmentation creates modified input examples—such as deleting, swapping, or replacing words—to improve model robustness. It is less reliable than image augmentation because tiny edits can change meaning. section 14.5.3

A simple word-edit example

Random deletion or swapping can turn “The rain in Spain falls mainly on the plain” into “The rain Spain falls plain on the mainly.” Such examples may improve resistance to typos and grammar mistakes, but word order changes can unintentionally alter the label or meaning. section 14.5.3

Use these practical rules:

  • Prefer edits that preserve meaning; synonym replacement can fail when a word has multiple meanings. section 14.5.3
  • Seek additional text examples before investing heavily in augmentation techniques. section 14.5.3

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines basic edits, demonstrates their risks, and stops short of recommending text augmentation as a widespread practice.
Examples
Uses random word deletion, word swapping, and synonym replacement, including a sentence whose word order is deliberately distorted.
What you can do after
Evaluate whether simple text edits improve robustness without changing an example’s intended meaning.
How it connects
Ties text augmentation to data augmentation, overfitting, word embeddings, synonym replacement, 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 Python, Third Edition. The section links point to the parts of the book it draws on.