Python Natural Language Processing Cookbook - Zhenya Antić - E-Book

Python Natural Language Processing Cookbook E-Book

Zhenya Antić

0,0
31,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 278

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Python Natural Language Processing Cookbook

Over 50 recipes to understand, analyze, and generate text for implementing language processing tasks

Zhenya Antić

BIRMINGHAM—MUMBAI

Python Natural Language Processing Cookbook

Copyright © 2021 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Kunal Parikh

Publishing Product Manager: Aditi Gour

Senior Editor: Mohammed Yusuf Imaratwale

Content Development Editor: Nazia Shaikh

Technical Editor: Manikandan Kurup

Copy Editor: Safis Editing

Project Coordinator: Aishwarya Mohan

Proofreader: Safis Editing

Indexer: Priyanka Dhadke

Production Designer: Roshan Kawale

First published: March 2021

Production reference: 2220421

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-83898-731-2

www.packt.com

Contributors

About the author

Zhenya Antić is a Natural Language Processing (NLP) professional working at Practical Linguistics Inc. She helps businesses to improve processes and increase productivity by automating text processing. Zhenya holds a PhD in linguistics from University of California Berkeley and a BS in computer science from Massachusetts Institute of Technology.

I would like to thank those who helped this book come to life. The whole Packt team, including Ali Abidi, Gebin George, Nazia Shaikh, Aayan Hoda, Steffie Rodrigues and Pooja Yadav, has been really helpful, providing insight and tips when necessary.

I would also like to thank all the technical reviewers, including Mayank Rasu and Dylan Vivier, as well as Vera Gor, for their insightful comments about the code.

A special thanks goes to Miloš Babić, who reviewed the whole book, and Andjelka Zečević, who reviewed the deep learning sections. They provided very useful feedback.

Finally, I would like to thank my family for their constant support.

About the reviewers

Mayank Rasu is the author of the book Hands-On Natural Language Processing with Python. He has more than 12 years of global experience as a data scientist and quantitative analyst in the investment banking domain. He has worked at the intersection of finance and technology and has developed and deployed AI-based applications in the finance domain, which include sentiment analyzer, robotics process automation, and deep learning-based document reviewers. Mayank is also an educator and has trained/mentored working professionals on applied AI.

Dylan Vivier is a data science enthusiast with experience in the automotive, oil and gas, and shipbuilding industries. With engineering degrees from both the University of Detroit and Purdue University, he has also studied at the Indiana University Luddy School of Informatics, Computing, and Engineering. In his spare time, Dylan enjoys researching new applications for data science and playing chess. Diversity and inclusion, Agile project development, Python, SQL, algorithms, data structures, Condition-based Maintenance (CBM), cybersecurity, machine learning, Natural Language Processing (NLP), Internet of Things (IoT), AI, and Blockchain are some of his other interests.

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

Packt is searching for authors like you

Leave a review - let other readers know what you think