Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
A Beginner's guide to the spaCy NLP library
Rating: 3.2 out of 5(3 ratings)
662 students

A Beginner's guide to the spaCy NLP library

A visual tour of spaCy Document objects
Last updated 9/2024
English

What you'll learn

  • Learn spaCy basics in less than an hour
  • Why spaCy is much easier to learn within a notebook environment
  • How visualizing the various spaCy objects can help you get lot more insight
  • How to use itables library to visualize spaCy objects

Course content

1 section14 lectures46m total length
  • Install relevant Python libraries1:42

    This lesson covers installing spaCy, pandas, and itables libraries, along with the en_core_web_md model.


    To get started, upload the attached notebook file to Google Colab and run the cells in order

  • Split text into sentences3:19

    How to split text into sentences using spaCy, create an nlp object, and present the results in an interactive table format.

  • Split text into words2:45

    This lesson covers spaCy's text tokenization, highlighting that tokens may not always correspond to individual words, with examples like dates and punctuation treated as separate tokens.

  • Part of speech tags2:42

    How to use spaCy to identify and visualize part of speech tags for tokens, including sorting the data in an interactive table format.

  • Stop words and punctuation2:39

    Filtering out stop words and punctuation when processing text can enhance insights, especially in visualizations like word clouds, ensuring key themes stand out clearly.

  • Span5:37

    This lesson demonstrates creating text spans in spaCy using token indices, visualizing data with itables, and understanding character-level positions.

  • Dependency Parse Tree7:04

    How to visualize dependency parse trees using spaCy's displaCy tool, highlighting token relationships and sentence structure for effective text analysis.

  • Named Entity Recognition3:50

    This lesson demonstrates Named Entity Recognition using spaCy, highlighting entity visualization, categorization, and the process of identifying and labeling entities in text.

  • Token is_ attributes3:43

    This lesson explains how to analyze token attributes, including checks for alphabetical characters, digits, punctuation, stop words, and case formatting using various testing methods.

  • Token like_ attributes2:24

    This lesson explains spaCy's "like" attributes

  • More token attributes2:35

    This lesson explains spaCy token attributes, including dependency labels, lemmas, and morphological analysis, emphasizing cautious usage for effective information extraction and rule generation.

  • Remaining token attributes2:09

    Remaining token attributes - part of speech tags, sentence start indicators, and shape,

  • Visualizing the subtree2:58

    This lesson demonstrates how to visualize subtrees using itables by extracting token information, applying HTML markup, and formatting sentences for enhanced clarity and presentation.

  • Visualizing token head2:51

    How to visualize token heads in sentences using the itables library, applying HTML font colors to distinguish relationships between tokens effectively.

Requirements

  • Please do not take this course if you are not already fairly proficient in Python

Description

The makers of spaCy say this:


"For complex tasks, it’s usually better to train a statistical entity recognition model. However, statistical models require training data, so for many situations, rule-based approaches are more practical. This is especially true at the start of a project: you can use a rule-based approach as part of a data collection process, to help you “bootstrap” a statistical model.

Training a model is useful if you have some examples and you want your system to be able to generalize based on those examples. It works especially well if there are clues in the local context. For instance, if you’re trying to detect person or company names, your application may benefit from a statistical named entity recognition model.

Rule-based systems are a good choice if there’s a more or less finite number of examples that you want to find in the data, or if there’s a very clear, structured pattern you can express with token rules or regular expressions. For instance, country names, IP addresses or URLs are things you might be able to handle well with a purely rule-based approach."


In other words, even the makers of spaCy recommend that you do as much as you can with rule-based approaches, especially at the start of a project. This is all the more true if you are just beginning to learn spaCy.


In my opinion, it is much easier to use rule based systems once you develop a solid understanding of the spaCy document object. And it is very easy to develop this understanding using the visualization technique I explain in this course.

Who this course is for:

  • Intermediate Python programmers who wish to use spaCy for their Natural Language Processing tasks