My Account Log in

1 option

Python Natural Language Processing Cookbook : Over 60 Recipes for Building Powerful NLP Solutions Using Python and LLM Libraries / Zhenya Antic and Saurabh Chakravarty.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Antić, Zhenya, author.
Chakravarty, Saurabh, author.
Language:
English
Subjects (All):
Natural language processing (Computer science).
Python (Computer program language).
Physical Description:
1 online resource (312 pages)
Edition:
Second edition.
Place of Publication:
Birmingham, England : Packt Publishing Ltd., [2024]
Biography/History:
Antic Zhenya: Zhenya Antic, Ph. D. is an expert in AI and NLP. She is currently the Director of AI Automation at Arch Insurance, where she leads initiatives in Intelligent Document Processing and applies various AI solutions to complex problems. With extensive consulting experience, Zhenya has worked on numerous NLP projects with various companies. She holds a Ph. D. in Linguistics from the University of California, Berkeley, and a B. S. in Computer Science from the Massachusetts Institute of Technology. Chakravarty Saurabh: Saurabh Chakravarty, Ph. D. is a seasoned veteran in the software industry with over 20 years of experience in software development. A software developer at heart, he is passionate about programming. He has held various roles, including architect, lead engineer, and software developer, specializing in AI and large-scale distributed systems. Saurabh has worked with Microsoft, Rackspace, and Accenture, as well as with a few startups. He holds a Ph. D. in Computer Science with a specialization in NLP from Virginia Tech, USA. Saurabh lives in California with his wife, Tina, and daughter, Aaliya, and works for AWS in Santa Clara, California.
Summary:
Harness the power of Natural Language Processing to overcome real-world text analysis challenges with this recipe-based roadmap written by two seasoned NLP experts with vast experience transforming various industries with their NLP prowess. You’ll be able to make the most of the latest NLP advancements, including large language models (LLMs), and leverage their capabilities through Hugging Face transformers. Through a series of hands-on recipes, you’ll master essential techniques such as extracting entities and visualizing text data. The authors will expertly guide you through building pipelines for sentiment analysis, topic modeling, and question-answering using popular libraries like spaCy, Gensim, and NLTK. You’ll also learn to implement RAG pipelines to draw out precise answers from a text corpus using LLMs. This second edition expands your skillset with new chapters on cutting-edge LLMs like GPT-4, Natural Language Understanding (NLU), and Explainable AI (XAI)—fostering trust and transparency in your NLP models. By the end of this book, you'll be equipped with the skills to apply advanced text processing techniques, use pre-trained transformer models, build custom NLP pipelines to extract valuable insights from text data to drive informed decision-making.
Contents:
Cover
Title page
Copyright and credits
Dedication
Contributors
Table of Contents
Preface
Chapter 1: Learning NLP Basics
Technical requirements
Dividing text into sentences
Getting ready
How to do it…
There's more…
See also
Dividing sentences into words - tokenization
How to do it
Part of speech tagging
There's more
Combining similar words - lemmatization
Removing stopwords
Chapter 2: Playing with Grammar
Counting nouns - plural and singular nouns
Getting the dependency parse
Extracting noun chunks
Extracting subjects and objects of the sentence
Finding patterns in text using grammatical information
Chapter 3: Representing Text - Capturing Semantics
Creating a simple classifier
Putting documents into a bag of words
Constructing an N-gram model
Representing texts with TF-IDF
How it works…
Using word embeddings
Training your own embeddings model
Using BERT and OpenAI embeddings instead of word embeddings.
Getting ready
Retrieval augmented generation (RAG)
Chapter 4: Classifying Texts
Getting the dataset and evaluation ready
Performing rule-based text classification using keywords
Clustering sentences using K-Means - unsupervised text classification
Using SVMs for supervised text classification
Training a spaCy model for supervised text classification
Classifying texts using OpenAI models
Chapter 5: Getting Started with Information Extraction
Using regular expressions
Finding similar strings - Levenshtein distance
Extracting keywords
Performing named entity recognition using spaCy
Training your own NER model with spaCy
Fine-tuning BERT for NER
Chapter 6: Topic Modeling
LDA topic modeling with gensim
How to do it...
There's more...
Community detection clustering with SBERT
K-Means topic modeling with BERT
Topic modeling using BERTopic
Using contextualized topic models
Chapter 7: Visualizing Text Data
Technical requirements.
Visualizing the dependency parse
Visualizing parts of speech
Visualizing NER
Creating a confusion matrix plot
Constructing word clouds
Visualizing topics from Gensim
Visualizing topics from BERTopic
Chapter 8: Transformers and Their Applications
Loading a dataset
Tokenizing the text in your dataset
Classifying text
Using a zero-shot classifier
Generating text
Language translation
Chapter 9: Natural Language Understanding
Answering questions from a short text passage
Answering questions from a long text passage
Answering questions from a document corpus in an extractive manner
Answering questions from a document corpus in an abstractive manner
Summarizing text using pre-trained models based on Transformers
Detecting sentence entailment
Enhancing explainability via a classifier-invariant approach
Enhancing explainability via text generation
Getting ready.
How to do it
Chapter 10: Generative AI and Large Language Models
Model access
Running an LLM locally
Running an LLM to follow instructions
Augmenting an LLM with external data
Executing a simple prompt-to-LLM chain
Augmenting the LLM with external content
Creating a chatbot using an LLM
Generating code using an LLM
Generating a SQL query using human-defined requirements
Agents - making an LLM to reason and act
Using OpenAI models instead of local ones
Index
Other Books You May Enjoy.
Notes:
Includes index.
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
1-80324-144-6
OCLC:
1456999696

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account