liveBook · Manning

Normalization

As explained in Grokking AI Algorithms, Second Edition

Normalization is the standardization of textual representation, including characters, casing, whitespace, and related formatting.

Normalization standardizes text so equivalent content uses consistent characters, casing, whitespace, and related formatting. This helps prevent one meaning from being split across unnecessary tokens. section 11.7

Common normalization operations include:

  • Lowercase words to treat forms such as “The” and “the” as one token, reducing vocabulary size. Modern language-model pipelines may preserve casing when it carries meaning, such as “apple” versus “Apple.” section 11.7
  • Convert smart quotes to straight quotes so different character representations become consistent. section 11.7
  • Collapse runs of spaces, tabs, and line breaks into a single space. section 11.7
  • Choose how to handle accented characters and other special characters consistently. section 11.7

A small text cleanup

The forms “The cafe” and “the cafe” can be normalized by converting smart quotes, collapsing extra whitespace, and lowercasing. The result is more uniform text, although casing should be preserved when distinctions such as “apple” and “Apple” matter. section 11.7

Figure 11.12 Training data normalized
11_12

Use the normalized training-data figure to see the cleanup process as a visible before-and-after transformation. section 11.7

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains several cleanup operations and their trade-offs, but stops short of implementation details for accented characters.
Examples
Uses “cafe” versus “CAFÉ,” smart quotes, repeated whitespace, and casing distinctions such as “apple” versus “Apple.”
What you can do after
Apply normalization to make training text uniform while choosing deliberately whether to preserve meaningful casing.
How it connects
Connects normalization with tokens, vocabulary size, tokenization, traditional NLP pipelines, and modern language-model pipelines.

Also explained in

Compare how 21 books explain normalization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.