𝔖 Scriptorium
✦   LIBER   ✦

📁

Python Natural Language Processing Cookbook: Over 50 recipes to understand, analyze, and generate text for implementing language processing tasks

✍ Scribed by Zhenya Antić


Publisher
Packt Publishing
Year
2021
Tongue
English
Leaves
285
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Get to grips with solving real-world NLP problems, such as dependency parsing, information extraction, topic modeling, and text data visualization

Key Features

  • Analyze varying complexities of text using popular Python packages such as NLTK, spaCy, sklearn, and gensim
  • Implement common and not-so-common linguistic processing tasks using Python libraries
  • Overcome the common challenges faced while implementing NLP pipelines

Book Description

Python is the most widely used language for natural language processing (NLP) thanks to its extensive tools and libraries for analyzing text and extracting computer-usable data. This book will take you through a range of techniques for text processing, from basics such as parsing the parts of speech to complex topics such as topic modeling, text classification, and visualization.

Starting with an overview of NLP, the book presents recipes for dividing text into sentences, stemming and lemmatization, removing stopwords, and parts of speech tagging to help you to prepare your data. You'll then learn ways of extracting and representing grammatical information, such as dependency parsing and anaphora resolution, discover different ways of representing the semantics using bag-of-words, TF-IDF, word embeddings, and BERT, and develop skills for text classification using keywords, SVMs, LSTMs, and other techniques. As you advance, you'll also see how to extract information from text, implement unsupervised and supervised techniques for topic modeling, and perform topic modeling of short texts, such as tweets. Additionally, the book shows you how to develop chatbots using NLTK and Rasa and visualize text data.

By the end of this NLP book, you'll have developed the skills to use a powerful set of tools for text processing.

What you will learn

  • Become well-versed with basic and advanced NLP techniques in Python
  • Represent grammatical information in text using spaCy, and semantic information using bag-of-words, TF-IDF, and word embeddings
  • Perform text classification using different methods, including SVMs and LSTMs
  • Explore different techniques for topic modeling such as K-means, LDA, NMF, and BERT
  • Work with visualization techniques such as NER and word clouds for different NLP tools
  • Build a basic chatbot using NLTK and Rasa
  • Extract information from text using regular expression techniques and statistical and deep learning tools

Who this book is for

This book is for data scientists and professionals who want to learn how to work with text. Intermediate knowledge of Python will help you to make the most out of this book. If you are an NLP practitioner, this book will serve as a code reference when working on your projects.

Table of Contents

  1. Learning NLP Basics
  2. Playing with Grammar
  3. Representing text - capturing semantics
  4. Classifying Texts
  5. Getting started with information extraction
  6. Topic modeling
  7. Building Chatbots
  8. Visualizing text data

✦ Table of Contents


Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Chapter 1: Learning NLP Basics
Technical requirements
Dividing text into sentences
Getting ready
How to do it…
How it works…
There's more…
See also
Dividing sentences into words – tokenization
Getting ready
How to do it…
How it works…
There's more…
See also
Parts of speech tagging
Getting ready
How to do it…
How it works…
There's more…
See also
Word stemming
Getting ready
How to do it…
How it works…
There's more…
See also
Combining similar words – lemmatization
Getting ready
How to do it…
How it works…
There's more…
Removing stopwords
Getting ready…
How to do it…
How it works…
There's more…
Chapter 2: Playing with Grammar
Technical requirements
Counting nouns – plural and singular nouns
Getting ready
How to do it…
How it works…
There's more…
Getting the dependency parse
Getting ready
How to do it…
How it works…
See also
Splitting sentences into clauses
Getting ready
How to do it…
How it works…
Extracting noun chunks
Getting ready
How to do it…
How it works…
There's more…
See also
Extracting entities and relations
Getting ready
How to do it…
How it works…
There's more…
Extracting subjects and objects of the sentence
Getting ready
How to do it…
How it works…
There's more…
Finding references – anaphora resolution
Getting ready
How to do it…
How it works…
There's more…
Chapter 3: Representing Text – Capturing Semantics
Technical requirements
Putting documents into a bag of words
Getting ready
How to do it…
How it works…
There's more…
Constructing the N-gram model
Getting ready
How to do it…
How it works…
There's more…
Representing texts with TF-IDF
Getting ready
How to do it…
How it works…
There's more…
Using word embeddings
Getting ready
How to do it…
How it works…
There's more…
See also
Training your own embeddings model
Getting ready
How to do it…
How it works…
There's more…
See also
Representing phrases – phrase2vec
Getting ready
How to do it…
How it works…
See also
Using BERT instead of word embeddings
Getting ready
How to do it…
How it works…
Getting started with semantic search
Getting ready
How to do it…
How it works…
See also
Chapter 4: Classifying Texts
Technical requirements
Getting the dataset and evaluation baseline ready
Getting ready
How to do it…
How it works…
Performing rule-based text classification using keywords
Getting ready
How to do it…
How it works…
There's more…
Clustering sentences using K-means – unsupervised text classification
Getting ready
How to do it…
How it works…
Using SVMs for supervised text classification
Getting ready
How to do it…
How it works…
There's more…
Using LSTMs for supervised text classification
Getting ready
How to do it…
How it works…
Chapter 5: Getting Started with Information Extraction
Technical requirements
Using regular expressions
Getting ready
How to do it…
How it works…
There's more…
Finding similar strings: the Levenshtein distance
Getting ready
How to do it…
How it works…
There's more…
See also
Performing named entity recognition using spaCy
Getting ready
How to do it…
How it works…
There's more…
Training your own NER model with spaCy
Getting ready
How to do it…
How it works…
There's more…
See also
Discovering sentiment analysis
Getting ready
How to do it…
How it works…
Sentiment for short texts using LSTM: Twitter
Getting ready
How to do it…
How it works…
Using BERT for sentiment analysis
Getting ready
How to do it…
How it works…
There's more…
See also
Chapter 6: Topic Modeling
Technical requirements
LDA topic modeling with sklearn
Getting ready
How to do it…
How it works…
There's more…
LDA topic modeling with gensim
Getting ready
How to do it…
How it works…
There's more…
NMF topic modeling
Getting ready
How to do it…
How it works…
K-means topic modeling with BERT
Getting ready
How to do it…
How it works…
Topic modeling of short texts
Getting ready
How to do it…
How it works…
See also
Chapter 7: Building Chatbots
Technical requirements
Building a basic chatbot with keyword matching
Getting ready
How to do it…
How it works…
There's more…
Building a basic Rasa chatbot
Getting ready
How to do it…
How it works…
There's more…
See also
Creating question-answer pairs with Rasa
Getting ready
How to do it…
How it works…
Creating and visualizing conversation paths with Rasa
Getting ready
How to do it…
How it works…
Creating actions for the Rasa chatbot
Getting ready
How to do it…
How it works…
See also
Chapter 8: Visualizing Text Data
Technical requirements
Visualizing the dependency parse
Getting ready
How to do it…
How it works…
Visualizing parts of speech
Getting ready
How to do it…
How it works…
Visualizing NER
Getting ready
How to do it…
How it works…
Constructing word clouds
Getting ready
How to do it…
How it works…
There's more…
See also
Visualizing topics
Getting ready
How to do it…
How it works…
See also
Why subscribe?
Other Books You May Enjoy
Index


📜 SIMILAR VOLUMES


Natural Language Processing with Python
✍ Krishna Bhavsar, Naresh Kumar, Pratap Dangeti 📂 Library 📅 2017 🏛 Packt Publishing 🌐 English

Learn the tricks and tips that will help you design Text Analytics solutions Key Features ● Independent recipes that will teach you how to efficiently perform Natural Language Processing in Python ● Use dictionaries to create your own named entities using this easy-to-follow guide ● Learn how

Natural Language Processing in Action: U
✍ Hobson Lane, Hannes Hapke, Cole Howard 📂 Library 📅 2019 🏛 Manning Publications 🌐 English

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. About the Technology Recent advances in deep learning empower applications to understand text and speech with

Natural Language Processing with Python:
✍ Steven Bird, Ewan Klein, Edward Loper 📂 Library 📅 2009 🏛 O'Reilly Media 🌐 English

This book offers a highly accessible introduction to Natural Language Processing, the field that underpins a variety of language technologies ranging from predictive text and email filtering to automatic summarization and translation. You'll learn how to write Python programs to analyze the structur

Applied Natural Language Processing with
✍ Taweh Beysolow II 📂 Library 📅 2018 🏛 Apress 🌐 English

Learn to harness the power of AI for natural language processing, performing tasks such as spell check, text summarization, document classification, and natural language generation. Along the way, you will learn the skills to implement these methods in larger infrastructures to replace existing code