Jump to ratings and reviews
Rate this book

Natural Language Processing in Action: Understanding, analyzing, and generating text with Python

Rate this book
Summary

Natural Language Processing in Action is your guide to creating machines that understand human language using the power of Python with its ecosystem of packages dedicated to NLP and AI.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

Recent advances in deep learning empower applications to understand text and speech with extreme accuracy. The result? Chatbots that can imitate real people, meaningful resume-to-job matches, superb predictive search, and automatically generated document summaries—all at a low cost. New techniques, along with accessible tools like Keras and TensorFlow, make professional-quality NLP easier than ever before.

About the Book

Natural Language Processing in Action is your guide to building machines that can read and interpret human language. In it, you'll use readily available Python packages to capture the meaning in text and react accordingly. The book expands traditional NLP approaches to include neural networks, modern deep learning algorithms, and generative techniques as you tackle real-world problems like extracting dates and names, composing text, and answering free-form questions.

What's inside


Some sentences in this book were written by NLP! Can you guess which ones?
Working with Keras, TensorFlow, gensim, and scikit-learn
Rule-based and data-based NLP
Scalable pipelines

About the Reader

This book requires a basic understanding of deep learning and intermediate Python skills.

About the Author

Hobson Lane, Cole Howard, and Hannes Max Hapke are experienced NLP engineers who use these techniques in production.

Table of Contents


PART 1 - WORDY MACHINES
Packets of thought (NLP overview)
Build your vocabulary (word tokenization)
Math with words (TF-IDF vectors)
Finding meaning in word counts (semantic analysis)
PART 2 - DEEPER LEARNING (NEURAL NETWORKS)
Baby steps with neural networks (perceptrons and backpropagation)
Reasoning with word vectors (Word2vec)
Getting words in order with convolutional neural networks (CNNs)
Loopy (recurrent) neural networks (RNNs)
Improving retention with long short-term memory networks
Sequence-to-sequence models and attention
PART 3 - GETTING REAL (REAL-WORLD NLP CHALLENGES)
Information extraction (named entity extraction and question answering)
Getting chatty (dialog engines)
Scaling up (optimization, parallelization, and batch processing)

1114 pages, Kindle Edition

Published March 16, 2019

65 people are currently reading
269 people want to read

About the author

Hobson Lane

6 books3 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
32 (40%)
4 stars
33 (41%)
3 stars
11 (13%)
2 stars
1 (1%)
1 star
2 (2%)
Displaying 1 - 15 of 15 reviews
Profile Image for Alex.
10 reviews16 followers
October 30, 2018
An extremely good read on NLP / ML / DL topics. Mostly focused on DL for natural language processing/understanding/generation.
13 reviews
June 16, 2021
This book is somewhere between a recipe book and a textbook. It's got real examples of various NLP techniques, like a recipe book, but there are not enough of them to make it one; it's got some theory and history, like a textbook, but not rigorously or systematically enough to make it one. I read it as an introduction to NLP practice, and for that it's very useful (not least because it was published only two years ago as of this writing).

Explanations are usually precise and make sense, although the at the points where the prose is less than clear I'm not sure whether it's just a consequence of the difficult subject matter. The authors have adopted a casual style, similar to that of MOOC professors. While this, again, usually works, it sometimes feels like they're pandering or affecting that language. Admirably, the authors have generally chosen to highlight modern techniques to solving NLP problems while contextualizing them in a bit of history. They don't often fall into the textbook trap of discussing outmoded algorithms with such enthusiasm that you can't help but suspect that one of the authors did their PhD on it twenty years ago. (That said, I could have done without the extended discussion of the history of chatbots and AIML, which seems to have been one of those "standards" dreamed up in the academy and never actually used.)

Speaking of chatbots. the main conceit of the book is that they'll teach you all the building blocks on the road to making a chatbot. (Coincidentally — or not — one of the authors worked at Aira, a company that built a chatbot for the visually impaired.) This conceit sometimes becomes strained (they often say, "Here's a technique you might use in some other application, but let's talk about this other algorithm, which you'll actually use for the chatbot," and then they don't actually use it). And they don't even really teach you how to make a chatbot. But this is okay, because their explanations of the techniques are good enough. There is a little too much currency given to classical techniques — if-then trees, regular expressions, etcetera. I understand their importance in the past, and perhaps even today in some applications, but now NLP means almost solely AI techniques. They know this too, and don't develop the classical ideas enough for a reader to understand why in the world someone would use them rather than AI.

In the preface, the authors, who are three white guys, claim that the "outsized impact" of "prosocial, cooperative chatbots… is why and how the authors of this book came together… We hope that our words will leave their impression in your mind and propagate like a meme through the world of chatbots, infecting others with passion for building prosocial NLP systems." I suspect Hobson wrote this sentence, since in his bio he wrote that he's "passionate about openness and prosocial AI." Yet the book hardly touches on the ethical implications of their actions, giving only a few brief asides about some historical gaffes in production NLP systems. They tell you that biased data gives biased results, which is common sense; they don't tell you /how/ to get unbiased data or how to deal with the biased data you've got. It often seems that on the rare occasions when they do speak of prosocial AI, they think that "prosocial" means "kind" rather than "just" or even "good." While they're probably trying their best to address the ethics of AI, you can tell that they're engineers first.

I think that the greatest strength of the book is its clarity and its breadth. I have only a working knowledge of Python and Keras and linear algebra, and yet I was able to understand most of what they were saying (even when they were discussing the algorithms behind the Keras one-liners). And although the book is far from comprehensive, I feel that I have a decent foothold in field from which to branch out to deeper understanding. The authors also provide a Python library to go along with the book, which I haven't had the occasion to try, but it seems like they put a lot of effort into it.

Overall, the book is well-written and well-explained. It suffers from a rather loose structure and a lack of commitment to the theme (prosocial chatbots), but neither of these are grave faults. 3.7 stars.
26 reviews
July 12, 2021
After one of my master's projects, I had realized how little I knew with NLP. Going through the book I got a lot of ideas on how people actually use text. I highly recommend this book for anyone interested in the subject.
Profile Image for Tim.
270 reviews2 followers
January 2, 2022
You really gotta walk a long way before before you get anywhere with NLP.
Profile Image for Antonin Sulc.
41 reviews
July 31, 2021
Excellent introduction for those who have some background in NLP and would like to learn something about the state-of-the-art in NLP with TensorFlow.

I strongly recommend to anyone interested. The book is condensed with examples with very intuitive explanations.
613 reviews12 followers
July 6, 2024
A practical introduction to the topic of natural language processing with many examples in Python. The book explains the important concepts in an understandable way and without the need to sound clever.
158 reviews4 followers
April 23, 2020
It cover quite a few with good code sample. Recommended!
Profile Image for Mikolaj.
74 reviews3 followers
January 1, 2024
A clear and informative book about basic of NLP. I can easily recommend it to new engineers in this field of machine learning
1 review
February 27, 2025
The second edition of Natural Language Processing in Action by Hobson Lane and Maria Dyshel is a valuable resource for anyone looking to master NLP. Building on the strengths of the first edition, this updated version introduces cutting-edge techniques while maintaining its hands-on, accessible approach. Whether you're a data scientist, AI researcher, or software engineer, this book is an invaluable guide to building practical NLP solutions using Python.
The second edition significantly expands on the original by incorporating recent advancements in NLP, particularly in deep learning and transformer models. Some major enhancements include:
• Expanded Coverage of Transformers – While the first edition introduced basic neural networks, this edition provides an in-depth look at state-of-the-art models like BERT, GPT, and T5, with practical implementations.
• More Hands-On Projects – This edition places even greater emphasis on real-world applications, offering projects such as semantic search engines, text classification, and multilingual translation.
• Integration with Modern Libraries – The first edition focused on foundational NLP with TensorFlow and scikit-learn, whereas the second edition updates the tech stack to include PyTorch and spaCy, ensuring compatibility with the latest industry trends.
• Conversational AI Development – Unlike the previous edition, this book dedicates a full section to chatbot development, covering dialogue management, response generation, and real-world deployment strategies.
In particular the following chapters stood out for me:
• Introduction to NLP Pipelines – This foundational chapter sets the stage by explaining tokenization, stemming, and lemmatization using spaCy, making it easier for newcomers to grasp core concepts.
• Building Neural Networks for NLP – Readers are guided through creating deep learning models with PyTorch, bridging the gap between traditional machine learning and modern AI techniques.
• Transformers and Transfer Learning – This is one of the most valuable chapters, as it walks through implementing cutting-edge transformer models, a topic that was only briefly touched upon in the first edition.
• Conversational AI and Chatbots – A brand-new addition, this chapter provides a roadmap for building interactive AI-driven assistants using open-source tools.
• Deploying NLP Models – Unlike the first edition, which focused mostly on model training, this chapter emphasizes real-world deployment strategies using cloud services and APIs.
What makes the second edition of Natural Language Processing in Action stand out is its ability to balance theory with practice. The authors' expertise shines through in their clear explanations, step-by-step code examples, and engaging writing style. With its inclusion of transformers, conversational AI, and modern NLP frameworks, it is undoubtedly one of the best resources for mastering natural language processing today. Whether you're just starting out or looking to advance your expertise, this book will be a valuable addition to your library.
613 reviews12 followers
December 25, 2025
A very good introduction to the topic. It shows how natural language processing works, what is doable and where the limitations are.
Profile Image for Angel.
151 reviews12 followers
April 2, 2020
If there's one book worth its weight in gold, this would be it.

I'm impressed by the thorough analysis made on the fascinating field of Natural Language Processing made by the authors. They present the latest techniques AND code examples. Most books I've read present the mathematics but almost no reproducible code so I find it very difficult to test and visualize what they're explaining.

Not so with this text. Definitely need to reread again. I struggled mostly because of how much data it presents, that makes it hard to simply skim. Definitely need to re-read and retry the exercises. If any weakness I could find is only in latest chapters where they go in depth on the latest techniques, that they present Keras and Finite State Machines which are presented in Python code but not explained as that would make the text even bigger than it already is.
2 reviews
March 18, 2025
This book is great for both beginners and experienced ( NLP experts ) learners. It explains topics like preprocessing, TF-IDF, LDA, LSA, CNN, RNN, LSTM, and Attention in a clear and easy way. After each explanation, there are code examples to help us understand concepts better. Author uses real-life examples to show how the concepts work.
Yet to finish the book , will update the review(detailed review) once I finish the book.
98 reviews1 follower
May 27, 2025
...Unlike a programming language, where each keyword has an unambiguous interpretation, natural languages are much more fuzzy. Think about the sentence, “The chicken is ready to eat.” This could mean that a live chicken is about to eat its breakfast—or that a cooked chicken is ready in the oven. This fuzziness of natural language leaves the interpretation of each word open to you and introduces interesting challenges in understanding and generating human language...
Displaying 1 - 15 of 15 reviews

Can't find what you're looking for?

Get help and learn more about the design.