01Chapter 1: Why the same text looks different to a computerText can look identical on screen and still compare as unequal in a program. This happens because a computer stores text as numeric values, and more than one sequence of values can represent what a reader sees as the same character or phrase.3 min read
02Chapter 2: Code points, encodings, and what a character isAssume you know basic Python strings and have seen text stored as bytes in an encoding such as UTF-8. This chapter builds the model needed to clean text safely. The main idea is that a visible character, a Unicode code point, and a byte sequence are related, but they are not the same thing.3 min read
03Chapter 3: Case: lowercasing versus case foldingThis chapter assumes you know basic Python strings, functions, and list comprehensions. It also assumes that text can contain Unicode characters and that a tokenizer turns text into tokens such as words.3 min read
04Chapter 4: Unicode normalisation: NFC and NFDThis chapter assumes you know basic Python strings, functions, and list operations. You should also know that text may be stored as bytes in an encoding such as UTF-8, and that tokenisation splits text into units such as words.3 min read
05Chapter 5: Compatibility forms: NFKC and NFKDThis chapter assumes you know basic Python strings, list comprehensions, and the idea that text can be split into tokens. You should also know that Unicode assigns code points to characters and that UTF-8 encodes those code points as bytes.3 min read
06Chapter 6: Removing accents and diacritics safelyA diacritic is a mark added to a letter, such as the acute accent in é, the diaeresis in ï, or the tilde in ñ. Accent stripping removes these marks so that text such as café becomes cafe.3 min read
07Chapter 7: Cleaning whitespace and punctuationThis chapter assumes you know basic Python strings, loops, functions, and list comprehensions. It also assumes you know that text can contain Unicode characters and that tokenisation divides text into usable pieces such as words.3 min read
08Chapter 8: Tokenising before filteringThis chapter assumes you know basic Python strings, loops, list comprehensions, and functions. You should also know that a tokenizer splits text into smaller units called tokens, often words or punctuation marks.3 min read
09Chapter 9: Stop words: what to remove and whyThis chapter assumes you know basic Python, strings, functions, list comprehensions, and the idea that text can be split into tokens. A stop word is a frequent word that a text-processing task may ignore, such as “the”, “is”, “of”, or “to”. Stop words are not automatically useless. Their value d3 min read
10Chapter 10: Putting the steps in the right orderThis chapter assumes you know basic Python strings, loops, list comprehensions, and functions. You should also understand that text can be represented as Unicode characters or as encoded bytes, and that tokenisation splits text into smaller units such as words.3 min read
11Chapter 11: When not to clean: trade-offs by taskAssume you know Python strings, functions, list comprehensions, and the idea of tokens. This chapter focuses on choosing which cleaning steps to use. Cleaning text is useful because it reduces surface variation. However, every cleaning step can also remove information.3 min read