Natural Language Processing in Action
Hobson Lane, Cole Howard, Hannes Hapke
  • MEAP began April 2017
  • Publication in Early 2018 (estimated)
  • ISBN 9781617294631
  • 300 pages (estimated)
  • printed in black & white

Natural Language Processing in Action is your guide to creating machines that understand human language. You'll start with a mental model of how a computer learns to read and interpret language. Then, you'll discover how to train a NLP machine to recognize patterns and extract information from text. As you explore the carefully-chosen examples, you'll expand your machine's knowledge and apply it to a range of challenges, from building a search engine that can find documents based on their meaning rather than merely keywords, to training a chatbot that uses deep learning to answer questions and participate in a conversation.

Table of Contents detailed table of contents

Acknowledgments

Part 1: Finding Meaning in Natural Language

1 The Language of Thought

1.1 The Magic

1.2 Practical Applications

1.3 What is Driving NLP Advances?

1.4 Language through a Computer’s "Eyes"

1.4.1 The Language of Locks (Regular Expressions)

1.4.2 A Simple Chatbot

1.4.3 Another Way

1.5 A Brief Overflight of Hyperspace

1.6 Word Order and Grammar

1.7 A Chatbot Natural Language Pipeline

1.8 Processing in Depth

1.9 Natural Language IQ

1.10 Summary

2 Build Your Vocabulary

2.1 Building your vocabulary through tokenization

2.1 A Token Improvement

2.2.1 Contractions

2.3 Extending your vocabulary with N-grams

2.3.1 What are N-grams?

2.3.2 Stopwords

2.4 Normalizing your vocabulary

2.4.1 Case normalization

2.4.2 Stemming

2.4.3 Lemmatization

2.4.4 Use Cases

2.5 Summary

3 Math with Words

3.1 Bag of Words

3.2 Vectorizing

3.3 Zipf’s Law

3.4 Topic Modeling

3.4.1 Return of Zipf

3.4.2 Relevance Ranking

3.4.3 Tools

3.4.4 Alternatives

3.5 Summary

4 Finding Meaning in Word Counts

4.1 From Word Counts to Topics

4.2 Latent Semantic Analysis (LSA)

4.3 Singular Value Decomposition (SVD)

4.4 Truncated SVD

4.5 SciKit-Learn vs gensim

4.5.1 PCA on a Point Cloud

4.5.2 Let’s Stop Horsing Around and Get Back to NLP

4.5.3 PCA on SMS Messages

4.5.4 Truncated SVD

4.5.5 Which one is Better for Spam Classification?

4.5.6 A Simple Classifier

4.6 Latent Dirichlet Allocation (LDiA)

4.6.1 The LDiA Idea

4.6.2 LDiA Topic Model for SMS Messages

4.6.3 LDiA + LDA = Spam Classifier

4.6.4 A Fairer Comparison: 32 LDiA Topics

4.7 Distance and Similarity

4.8 Steering

4.8.1 Linear Discriminant Analysis (LDA)

4.9 Topic Vector Power

4.10 "Like" Prediction

4.11 Summary

Part 2: Deeper Learning

5 Baby Steps with Neural Networks

6 Reasoning with Word Vectors (Word2vec)

6.1 Vector-Oriented Reasoning

6.2 Applications for Word Vectors

6.3 How to compute the Word Vector Representations?

6.3.1 Skip-gram Approach

6.3.2 Continous Bag of Words Approach

6.3.3 Skip-gram vs. Continous Bag of Words: When to use which approach

6.3.4 Computational Tricks of Word2vec

6.4 How to use Gensim’s Word2vec module?

6.5 How to generate your own Word vector representations?

6.5.1 Preprocess Steps

6.5.2 Train your domain-specific Word2vec model

6.6 Word2vec vs GloVe (Global Vector)

6.7 Word2vec vs LSA

6.8 Doc2Vec

6.9 Summary

7 Getting Words in Order with Convolutional Neural Networks (CNNs)

8 Loopy (Recurrent) Neural Networks (RNNs)

9 Improving Retention with Long Short-Term Memory Networks (LSTMs)

10 Attention Networks, Translation, and Sequence to Sequence Models

Part 3 Getting Real

11 Information Extraction

12 Getting Chatty

13 Generative Models

14 Scaling Up

Appendixes

Appendix A: A Your NLP Tools

Appendix B: B Playful Python

Appendix C: C Vectors and Matrices (Linear Algebra)

Appendix D: D Machine Learning

About the Technology

Most humans are pretty good at reading and interpreting text; computers...not so much. Natural Language Processing (NLP) is the discipline of teaching computers to read more like people, and you see examples of it in everything from chatbots to the speech-recognition software on your phone. Modern NLP techniques based on machine learning radically improve the ability of software to recognize patterns, use context to infer meaning, and accurately discern intent from poorly-structured text. NLP promises to help you improve customer interactions, save cost, and reinvent text-intensive applications like search or product support.

What's inside

  • Parsing and normalizing text
  • Rule-based (Grammar) NLP
  • Data-based (Machine Learning) NLP
  • Deep Learning NLP
  • End-to-end chatbot pipeline with training data
  • Scalable NLP pipelines
  • Hyperparameter optimization algorithms

About the reader

A basic understanding of machine learning and some experience with a modern programming language such as Python, Java, C++, or JavaScript will be helpful.

About the authors

Hobson Lane has more than 15 years of experience building autonomous systems that make important decisions on behalf of humans. Hannes Hapke is an Electrical Engineer turned Data Scientist with experience in deep learning. Cole Howard is a carpenter and writer turned Deep Learning expert.


Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Buy
MEAP combo $49.99 pBook + eBook
MEAP eBook $39.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks