Share E-Book

Python Natural Language Processing Cookbook, 2nd Edition (Zhenya Antić, Saurabh Chakravarty)(Z-Library)

Author

,

Python
Language English

Updated to include three new chapters on transformers, natural language understanding (NLU) with explainable AI, and dabbling with popular LLMs from Hugging Face and OpenAI Key Features Leverage ready-to-use recipes with the latest LLMs, including Mistral, Llama, and OpenAI models Use LLM-powered agents for custom tasks and real-world interactions Gain practical, in-depth knowledge of transformers and their role in implementing various NLP tasks with open-source and advanced LLMs Book Description 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 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.

Format EPUB
Size 5.9 MB
12
Views
0
Downloads
0.00
Total Donations

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
【One-Line Pitch】 A hands-on recipe collection for practitioners who already know Python and want to move from classic NLP preprocessing to modern transformer, RAG, and LLM-agent workflows. Best for data scientists, ML engineers, and developers who learn by running code rather than reading theory. 【Book Arc】 - **Opening (~0%–10%)**: Front matter, author backgrounds, and the book's promise—a recipe-based roadmap spanning classic NLP through LLMs, with three new chapters on transformers, NLU/XAI, and popular LLMs. - **Early (~10%–35%)**: Foundations of text processing—sentence splitting, tokenization, POS tagging, lemmatization, stopword removal—then grammar work (dependency parsing, noun chunks, subjects/objects) and text representation (bag-of-words, N-grams, TF-IDF, word embeddings, BERT/OpenAI embeddings, and a first RAG recipe). - **Middle (~35%–55%)**: Core applied tasks—text classification (rule-based, K-means, SVM, spaCy, GPT), information extraction (regex, Levenshtein, keywords, spaCy NER, fine-tuned BERT NER), and topic modeling including short texts like tweets, plus text visualization. - **Late (~55%–65%)**: Transformer-based recipes for classification, zero-shot classification, text generation, and translation, building toward the NLU chapter. - **Ending (~65%–100%)**: Natural Language Understanding (short/long-passage QA, extractive and abstractive corpus QA, summarization, sentence entailment, explainability via classifier-invariant and text-generation approaches) and Generative AI/LLMs (running Mistral/Llama locally, instruction following, external-data augmentation, prompt chains, chatbots, code and SQL generation, reasoning agents, and OpenAI models). 【Key Takeaways】 - **Recipes are the organizing unit, not theory** (Early): each topic is presented as Getting ready / How to do it / There's more, so you can jump to the task you need rather than reading linearly. - **Classic NLP still underpins modern pipelines** (Early): sentence segmentation, tokenization, POS tagging, and lemmatization are framed as prerequisites—especially for supplying context to LLM prompts. - **Text representation is the pivot from words to models** (Early–Middle): the book builds a simple classifier first, then swaps in bag-of-words, N-grams, TF-IDF, word embeddings, BERT, and OpenAI embeddings to show how encoding choices change results. - **Classification and information extraction are treated as the workhorse tasks** (Middle): multiple approaches per task—rule-based, unsupervised, SVM, spaCy, and GPT—let you compare trade-offs instead of committing to one method. - **RAG appears as a practical bridge between embeddings and LLMs** (Early–Middle): the book demonstrates retrieving precise answers from a text corpus rather than relying on model memory alone. - **NLU goes beyond labeling into answering and explaining** (Late): QA over passages and corpora, summarization, and entailment are paired with explainability techniques to build trust in model outputs. - **LLMs are taught as tools to orchestrate, not just call** (Ending): local Mistral/Llama, instruction following, prompt chains, chatbots, code/SQL generation, and agents that reason and act with external data. - **The second edition's new material is the main upgrade** (Late–Ending): transformers, NLU with XAI, and the LLM chapter distinguish this from the first edition; excerpts do not detail every recipe's internals. 【Reading Tips】 - **Skim the setup chapters, deep-read the recipes you need**: environment setup (Poetry, pip, conda, CUDA) is boilerplate; the value is in the How-to steps and "There's more" variations. - **Run the code from the GitHub repository**: the book explicitly recommends typing or cloning the notebooks to avoid copy-paste errors; the Sherlock Holmes text is used as a running example. - **Treat representation chapters as the conceptual hinge**: if you understand why TF-IDF, embeddings, and BERT differ, the later classification and RAG recipes become much easier to adapt. - **Use the LLM/agent chapter as a project menu**: pick one recipe (chatbot, SQL generation, or reasoning agent) and extend it with your own data rather than reading all recipes passively. - **Watch for hardware and API prerequisites**: GPU recipes need CUDA/cuDNN drivers, and OpenAI recipes require model access—plan around these before starting the later chapters. 【Coverage Limits】 This guide is synthesized from front matter, table of contents, preface, and early recipe excerpts; it does not cover the detailed code or results of most middle and late recipes, so specific implementation nuances are not represented.

Passage locations

Excerpt 1
s from text data to drive informed decision-making. cover B18411_FM Python Natural Language Processing Cookbook Over 60 recipes for building powerful NLP sol...
View in text
Excerpt 2
ents, maintaining park grounds, and rescuing elephants.
View in text
Excerpt 3
maintaining park grounds, and rescuing elephants. B18411_TOC_ePub Table of Contents Preface 1 Learning NLP Basics Technical requirements Dividing text into s...
View in text
Excerpt 4
R model. Finally, we show how to fine-tune a BERT NER model. Chapter 6 , Topic Modeling , shows how to determine topics of text using various unsupervised me...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List