This is the code repository for Mastering NLP from Foundations to Agents, Second Edition, published by Packt.
Purchase the book on Amazon here
Mastering NLP from Foundations to Agents, Second Edition
-
Lior Gazit is an ML leader with extensive experience building and leading teams that deliver production NLP systems, LLM applications, and AI-driven products. Lior focuses on practical system design, evaluation, and operational reliability, with deep expertise across NLP, LLMs, and agentic workflows.
-
Meysam Ghaffari is a senior data scientist specializing in NLP and deep learning. He has built and improved ML and NLP systems in healthcare and beyond, with strong expertise in model development, experimentation, and applied research.
This repository includes the notebooks and code examples that accompany the book. The code is organized by chapter to make it easy to follow along while reading.
Example snippet
import pandas as pd
import matplotlib.pyplot as plt
import requests- Build end-to-end NLP systems from foundations to modern LLM workflows
- Implement RAG pipelines, advanced orchestration patterns, and agentic systems
- Learn practical evaluation, guardrails, and production considerations for real deployments
- Apply system design thinking to AI-native products including analytics, search, and automation
This book is for NLP practitioners, ML engineers, data scientists, educators, and STEM students who want to build modern NLP and LLM systems. A working knowledge of Python plus basic ML familiarity will help you get the most value.
You can run the notebooks using Google Colab or a local environment.
| Chapter | Software required | OS required |
|---|---|---|
| 1 to 13 | Python environment with the ability to install packages, plus access to any required API keys for optional hosted LLM examples | Windows, macOS, or Linux |
| 1 to 13 | For heavier deep learning and LLM workloads, a GPU is recommended. Google Colab can be sufficient for many examples |
-
Chapter 4 notebooks Chapter 4 notebooks
-
Chapter 5 notebooks Chapter 5 notebooks
-
Chapter 6 notebooks Chapter 6 notebooks
-
Chapter 10 notebooks Chapter 10 notebooks
-
Chapter 11 notebooks Chapter 11 notebooks
- Navigating the NLP Landscape, A Comprehensive Introduction
- Mastering Linear Algebra, Probability, and Statistics for ML and NLP
- Unleashing Machine Learning Potentials in NLP
- Streamlining Text Preprocessing Techniques for Optimal NLP Performance
- Empowering Text Classification, Leveraging Traditional ML Techniques
- Text Classification Reimagined, Deep Learning and Transformer Models
- Demystifying LLMs, Theory, Design, and Implementation
- Advanced Topics in Fine-Tuning, Alignment, and Reasoning
- Advanced Setup and Integration, RAG and MCP
- Advanced LLM Practices
- Multi-Agent Solutions and Advanced Agent Frameworks
- Technical Guardrails, The Architecture of AI Safety and Responsible Implementation
- AI-Native Products and Industry Perspectives
- Clone the repository
- Open the relevant chapter notebook folder
- Run notebooks in Google Colab or in a local Python environment
- Install dependencies as prompted in each notebook
If you find a bug, a broken dependency, or a notebook that no longer runs, please open a GitHub issue with:
- Chapter and notebook name
- Your environment details
- The error trace and the cell where it occurred
