Tokenization
Tokenization breaks text into smaller units called tokens. Tokens can be words, subwords, or sentences depending on the tokenizer. Example (word-level tokenization): Tokens:Zara, is, running, quickly, through, the, park, because, she, wants, to, catch, the, last, train
Why tokenization matters:
- Models require discrete, manageable units to learn relationships between tokens.
- Subword tokenizers (used by most transformer models) split rare or compound words into subword pieces so the model can handle unseen forms.
- Choice of tokenizer affects vocabulary size, downstream performance, and handling of out-of-vocabulary words.
Normalization
Normalization makes tokens consistent by applying standard formatting steps like lowercasing, punctuation removal, and collapsing whitespace. These are simple but impactful transformations. Common normalization steps:- Lowercasing:
Zara→zara - Punctuation removal:
train.→train - Whitespace normalization: collapse extra spaces or tabs

Normalization choices depend on your task. Preserve case or punctuation when they are meaningful for downstream analysis.
Stop-word removal
Stop words are high-frequency words that often contribute little signal for some analyses (e.g.,the, is, to). Removing them can reduce input size and sometimes improve performance for traditional NLP pipelines.
Example after removing common stop words (is, through, the, because, she, to):
- Modern transformer models often rely on stop words for syntactic context; removing them can degrade performance.
- Removing stop words can change meaning (e.g., “I like this” vs. “I do not like this”).
Stop-word removal can change sentence meaning. Only remove stop words when you are sure it won’t harm your downstream task.
Lemmatization
Lemmatization reduces inflected words to their dictionary (base) form, called a lemma, using morphological analysis and POS information. Examples:running→runwants→want

POS tagging
Part-of-speech (POS) tagging assigns a grammatical label to each token (noun, verb, adjective, etc.). POS tags provide syntactic context and help disambiguate words that can function differently in different contexts. Example POS tags for the lemmatized sentence:Zara→ PROPN (proper noun)run→ VERBquickly→ ADV (adverb)park→ NOUNwant→ VERBcatch→ VERBlast→ ADJ (adjective)train→ NOUN
run as VERB vs. NOUN). This syntactic information supports tasks such as information extraction, dependency parsing, and feature engineering.

Summary
Core preprocessing techniques and their primary purpose:
Use these techniques in combination depending on the task and model:
- For classic pipelines (e.g., bag-of-words, TF-IDF) normalization, stop-word removal, and lemmatization are common.
- For transformer-based models, minimal normalization and careful preservation of tokens (including stop words and punctuation) often yield better results.
Links and References
- Hugging Face Tokenizers: https://huggingface.co/docs/tokenizers
- spaCy documentation (tokenization, lemmatization, POS): https://spacy.io/usage
- NLTK (classic NLP tools): https://www.nltk.org/
- Transformer models and tokenization best practices: https://huggingface.co/docs/transformers/index