NLP: From Simple to Spectacular
Welcome
This website is for the book NLP: From Simple to Spectacular, which is geared towards programmers interested in natural language processing. We’ll cover all kinds of concepts in this book, from stupidly simple models to state of the art.
What is NLP?
Natural language processing (or NLP) is a subfield of artificial intelligence focused on applying learning algorithms to natural language. There’s many ways to use such algorithms, for understanding language, text generation, and speech recognition to name a few. In a nutshell, an NLP model accepts a string of text, infers some understanding of it, and outputs it’s understanding as numbers. The process of creating such a model is what this book focuses on.
What this book is
As somebody who’s a programmer and not a mathematician, I always struggle with blog posts about machine learning. They throw some math equations at you and show you how to “implement” the algorithm in two lines of code using a framework, but rarely do I see implementations from scratch. This book aims to bridge that gap. The content will be programming first with little to no math or theory. Any “mathy” stuff will be picked apart with coding examples and visualizations. Algorithms will be implemented in pure python as much as possible. Frameworks will be introduced incrementally where it makes sense.
The gimmick behind this book is to walk through implementations of different models using one dataset. Each chapter incrementally changing our models while introducing new concepts. Where possible, each chapter will start with the quickest way to get the model up and running with scikit-learn
, pytorch
, or some other framework, followed by implementations from scratch. With that in mind, I recommend starting at the beginning and finishing at the end, but feel free to jump around if that makes more sense for you.
This book is written entirely in jupyter notebooks so you can run the code. Each chapter lives in it’s own directory. A conda environment file is provided at the root of the project with everything you need to run each chapter in this book.
Asking for help
I assume you have some grasp of Python and how to use external packages. This book may be difficult otherwise. Code blocks will include comments where necessary to help walk you through what’s going on. I will try to comment on what different functions do, but if I miss something or you want a deeper explanation then reach for your search engine. If I think something needs a little explanation but isn’t essential to the post I’ll note it in the margin. Check out the right margin to see what I mean.
However, if you have questions about the concepts I go over or find my explanations confusing, don’t be afraid to drop me an email at . If you’re confused by what I write, somebody else probably is to and I can update the post to be more clear.
Prerequisites
Familiarity with Python and how to use external packages as I’ve already mentioned. There are a few packages we will rely on for machine learning adjacent tasks.
I recommend at least walking through the introductory tutorials for these if you’re not familiar with them.
Fundamental AI packages we’ll learn about
Separately, there’s some machine learning packages we will use throughout the book.
These libraries are fundamental for machine learning and deep learning. It’s worth looking at their docs when these packages show up.
Things you don’t need but should know
While you don’t need to know anything about conda or jupyter to read this book, I highly recommend using them if you’re serious about machine learning.