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 Mastering spaCy
  • Table Of Contents Toc
Mastering spaCy

Mastering spaCy - Second Edition

By : Déborah Mesquita, Duygu Altinok
5 (1)
close
close
Mastering spaCy

Mastering spaCy

5 (1)
By: Déborah Mesquita, Duygu Altinok

Overview of this book

Mastering spaCy, Second Edition is your comprehensive guide to building sophisticated NLP applications using the spaCy ecosystem. This revised edition builds on the expertise of Duygu Altinok, a seasoned NLP engineer and spaCy contributor, and introduces new chapters by Déborah Mesquita, a data science educator and consultant known for making complex concepts accessible. This edition embraces the latest advancements in NLP, featuring chapters on large language models with spacy-llm, transformer integration, and end-to-end workflow management with Weasel. You’ll learn how to enhance NLP tasks using LLMs, streamline workflows using Weasel, and integrate spaCy with third-party libraries like Streamlit, FastAPI, and DVC. From training custom Named Entity Recognition (NER) pipelines to categorizing emotions in Reddit posts, this book covers advanced topics such as text classification and coreference resolution. Starting with the fundamentals—tokenization, NER, and dependency parsing—you’ll explore more advanced topics like creating custom components, training domain-specific models, and building scalable NLP workflows. Through practical examples, clear explanations, tips, and tricks, this book will equip you to build robust NLP pipelines and seamlessly integrate them into web applications for end-to-end solutions.
Table of Contents (17 chapters)
close
close
Lock Free Chapter
1
Part 1: Getting Started with spaCy
4
Part 2: Advanced Linguistic and Semantic Analysis
9
Part 3: Customizing and Integrating NLP Workflows

Introducing Tokenization

We saw in Figure 2.1 that the first step in a text processing pipeline is tokenization. Tokenization is always the first operation because all the other operations require tokens.

Tokenization simply means splitting the sentence into its tokens. You can think of a token as the smallest meaningful part of a piece of text. Tokens can be words, numbers, punctuation, currency symbols, and any other meaningful symbols that are the building blocks of a sentence. The following are examples of tokens:

USA
N.Y.
City
33
3rd
!
…
?
's

Input to the spaCy tokenizer is Unicode text and the result is a Doc object. The following code shows the tokenization process:

  1. First, we import the library and load the English language model:
    import spacy
    nlp = spacy.load("en_core_web_md")
  2. Next, we apply the nlp object to a sentence to create a Doc object. The Doc object is the container for a sequence of Token objects. We then print the token texts...
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.
Mastering spaCy
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