nlp

Natural language processing tutorials covering text analysis and language tasks in Python.

NLP: Transformer Architecture, Attention Is All You Need

This is the transformer architecture explained in plain language: the design that powers GPT, BERT, and every modern AI system. You will implement self-attention, multi-head attention, and positional encoding from scratch in Python. The Transformer is the single most important architecture in deep learning, and once it clicks you will see it everywhere. “Attention is all you need.” Ashish Vaswani, Google Brain Last Updated: July 2026 | Tested on: Python 3.14.6, PyTorch 2.12.1, NumPy 2.4.6 | Difficulty: Expert | Reading ... Read More

NLP: BERT, GPT, and Modern Language Models

This BERT vs GPT comparison walks through the two architectures that shaped modern NLP (Natural Language Processing): BERT (an encoder that reads text bidirectionally to understand it) and GPT (a decoder that reads left to right to generate it). We line up their pre-training objectives, their attention patterns, and when to reach for each one, all with code you can run. “Language models are unsupervised multitask learners.” Alec Radford, OpenAI Last Updated: July 2026 | Tested on: Python 3.14.6, transformers ... Read More

ML: NLP Basics, Tokenization and TF-IDF

A model cannot read. Feed it ten thousand product reviews and it sees nothing but bytes until you turn each sentence into numbers. That translation step is what NLP basics are really about: tokenize the text, drop the noise words, normalize what remains, and score every term with TF-IDF. This post walks that whole path with NLTK and scikit-learn, ending in a working classifier. “There should be one, and preferably only one, obvious way to do it.” Tim Peters, The ... Read More