Natural Language Processing with Python and spaCy

Book description

Natural Language Processing with Python and spaCy will show you how to create NLP applications like chatbots, text-condensing scripts, and order-processing tools quickly and easily. You’ll learn how to leverage the spaCy library to extract meaning from text intelligently; how to determine the relationships between words in a sentence (syntactic dependency parsing); identify nouns, verbs, and other parts of speech (part-of-speech tagging); and sort proper nouns into categories like people, organizations, and locations (named entity recognizing). You’ll even learn how to transform statements into questions to keep a conversation going.

You’ll also learn how to:

•Work with word vectors to mathematically find words with similar meanings (Chapter 5)

•Identify patterns within data using spaCy's built-in displaCy visualizer (Chapter 7)

•Automatically extract keywords from user input and store them in a relational database (Chapter 9)

•Deploy a chatbot app to interact with users over the internet (Chapter 11)

“Try This” sections in each chapter encourage you to practice what you’ve learned by expanding the book’s example scripts to handle a wider range of inputs, add error handling, and build professional-quality applications.

By the end of the book, you’ll be creating your own NLP applications with Python and spaCy.

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. About the Authors
  5. About the Technical Reviewer
  6. BRIEF CONTENTS
  7. CONTENTS IN DETAIL
  8. INTRODUCTION
    1. Using Python for Natural Language Processing
    2. The spaCy Library
    3. Who Should Read This Book?
    4. What’s in the Book?
  9. 1 HOW NATURAL LANGUAGE PROCESSING WORKS
    1. How Can Computers Understand Language?
    2. What Is a Statistical Model in NLP?
    3. What Is Still on You
    4. Summary
  10. 2 THE TEXT-PROCESSING PIPELINE
    1. Setting Up Your Working Environment
    2. Installing Statistical Models for spaCy
    3. Basic NLP Operations with spaCy
    4. Summary
  11. 3 WORKING WITH CONTAINER OBJECTS AND CUSTOMIZING SPACY
    1. spaCy’s Container Objects
    2. Customizing the Text-Processing Pipeline
    3. Using spaCy’s C-Level Data Structures
    4. Summary
  12. 4 EXTRACTING AND USING LINGUISTIC FEATURES
    1. Extracting and Generating Text with Part-of-Speech Tags
    2. Using Syntactic Dependency Labels in Text Processing
    3. Summary
  13. 5 WORKING WITH WORD VECTORS
    1. Understanding Word Vectors
    2. Installing Word Vectors
    3. Comparing spaCy Objects
    4. Summary
  14. 6 FINDING PATTERNS AND WALKING DEPENDENCY TREES
    1. Word Sequence Patterns
    2. Extracting Keywords from Syntactic Dependency Trees
    3. Using Context to Improve the Ticket-Booking Chatbot
    4. Making a Smarter Chatbot by Finding Proper Modifiers
    5. Summary
  15. 7 VISUALIZATIONS
    1. Getting Started with spaCy’s Built-In Visualizers
    2. Visualizing from Within spaCy
    3. Customizing Your Visualizations with the Options Argument
    4. Exporting a Visualization to a File
    5. Using displaCy to Manually Render Data
    6. Summary
  16. 8 INTENT RECOGNITION
    1. Extracting the Transitive Verb and Direct Object for Intent Recognition
    2. Finding the Meanings of Words Using Synonyms and Semantic Similarity
    3. Extracting Intent from a Sequence of Sentences
    4. Summary
  17. 9 STORING USER INPUT IN A DATABASE
    1. Converting Unstructured Data into Structured Data
    2. Building a Database-Powered Chatbot
    3. Summary
  18. 10 TRAINING MODELS
    1. Training a Model’s Pipeline Component
    2. Training the Entity Recognizer
    3. Creating a New Dependency Parser
    4. Summary
  19. 11 DEPLOYING YOUR OWN CHATBOT
    1. How Implementing and Deploying a Chatbot Works
    2. Using Telegram as a Platform for Your Bot
    3. Summary
  20. 12 IMPLEMENTING WEB DATA AND PROCESSING IMAGES
    1. How It Works
    2. Making Your Bot Find Answers to Questions from Wikipedia
    3. Reacting to Images Sent in a Chat
    4. Putting All the Pieces Together in a Telegram Bot
    5. Summary
  21. LINGUISTIC PRIMER
    1. Dependency Grammars vs. Phrase Structure Grammars
    2. Common Grammar Concepts
  22. INDEX

Product information

  • Title: Natural Language Processing with Python and spaCy
  • Author(s): Yuli Vasiliev
  • Release date: April 2020
  • Publisher(s): No Starch Press
  • ISBN: 9781718500525