Part I: From Text to Mathematical Objects

Text is a flexible sequence of characters, while model calculations require numbers arranged in explicit structures. The useful structure depends on the task. A classifier may use fixed feature coordinates, while a language model needs an ordered token sequence.

Foundations separated inference, training, and evaluation. Each mode still depends on an earlier preparation step: specify the input, define the required output, and retain any reference information needed to judge that output. This part constructs those objects before later parts calculate predictions and parameter updates.

Chapter 1 pairs inputs with targets and shows how individual prediction errors form an objective. Chapter 2 maps text units to integer IDs and explains rectangular batches. Chapter 3 constructs reusable subword pieces and a count-based prediction baseline. Chapter 4 turns document terms into fixed feature columns and class scores. The resulting token sequences and feature rows become the inputs for the score, probability, loss, and evaluation calculations in Part II. The count-based predictor is a sequence baseline, not a required stage before the document classifier.

Part I opener showing the chapters in From text to mathematical objects, with each chapter's purpose, input, operation, result, and dependency arrows.
Figure I.1: Targets, token IDs, subwords, and feature matrices establish the inputs used by later models.

Chapters in this part