liveBook · Manning

Standard

As explained in Deep Learning with Python, Third Edition

The preprocessing step that normalizes text before tokenization, such as lowercasing.

Text standardization normalizes input before tokenization so accidental encoding differences do not become separate tokens. Lowercasing, punctuation removal, and sometimes accent removal make nearly identical sentences easier to represent consistently. section 14.2

Making two sentences more alike

“sunset came. i was staring at the Mexico sky. Isnt nature splendid??” and “Sunset came; I stared at the México sky. Isn’t nature splendid?” initially produce different representations. Lowercasing and removing punctuation yields nearly identical text; removing accents can reduce the remaining difference. section 14.2

A practical standardization pipeline can use these decisions:

  • Convert input to lowercase when capitalization should not distinguish tokens. section 14.2.1
  • Remove punctuation when punctuation is not useful for the modeling task. section 14.2
  • Remove accent marks when accented and unaccented forms should be treated alike. section 14.2
  • Apply the same choices while building the vocabulary and transforming new inputs. section 14.2.1

Standardization is the first stage of tokenization: it normalizes text, splitting creates tokens, and indexing assigns integer IDs. It is useful feature engineering, but it should be chosen deliberately because some tasks need case or punctuation. section 14.6 section 15.1.1

Figure 14.1 The text preprocessing pipeline
text pipeline

Use the preprocessing pipeline to place standardization before splitting and indexing. section 14.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains motivation, lowercase implementation, punctuation and accent choices, but defers task-specific normalization design.
Examples
Uses paired sentences differing in case, accents, punctuation, and contractions, plus character and word tokenizer implementations.
What it assumes
Assumes basic text preprocessing and vocabulary concepts while introducing standardization within tokenization.
What you can do after
Apply it by implementing consistent normalization in a character- or word-level tokenizer.
How it connects
Connects standardization with tokenization, splitting, indexing, vocabulary construction, feature engineering, and search engines.

Also explained in

Compare how 6 books explain standard →

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.