Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Natural Language Processing Cookbook
  • Table Of Contents Toc
Python Natural Language Processing Cookbook

Python Natural Language Processing Cookbook - Second Edition

By : Zhenya Antić, Saurabh Chakravarty
5 (5)
close
close
Python Natural Language Processing Cookbook

Python Natural Language Processing Cookbook

5 (5)
By: Zhenya Antić, Saurabh Chakravarty

Overview of this book

Harness the power of Natural Language Processing (NLP) 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.
Table of Contents (13 chapters)
close
close

Using word embeddings

In this recipe, we will switch gears and learn how to represent words using word embeddings, which are powerful because they are a result of training a neural network that predicts a word from all other words in the sentence. Embeddings are also vectors, but usually of a much smaller size, 200 or 300. The resulting vector embeddings are similar for words that occur in similar contexts. Similarity is usually measured by calculating the cosine of the angle between two vectors in the hyperplane, with 200 or 300 dimensions. We will use the embeddings to show these similarities.

Getting ready

In this recipe, we will use a pretrained word2vec model, which can be found at https://github.com/mmihaltz/word2vec-GoogleNews-vectors. Download the model and unzip it in the data directory. You should now have a file with the …/data/GoogleNews-vectors-negative300.bin.gz path.

We will also use the gensim package to load and use the model. It should be installed...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Natural Language Processing Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon