1. Learn
  2. /
  3. Courses
  4. /
  5. Natural Language Processing with spaCy

Connected

Exercise

Running a spaCy pipeline

You've already run a spaCy NLP pipeline on a single piece of text and also extracted tokens of a given list of Doc containers. In this exercise, you'll practice the initial steps of running a spaCy pipeline on texts, which is a list of text strings.

You will use the en_core_web_sm model for this purpose. The spaCy package has already been imported for you.

Instructions

100 XP
  • Load the en_core_web_sm model as nlp.
  • Run an nlp() model on each item of texts, and append each corresponding Doc container to a documents list.
  • Print the token texts for each Doc container of the documents list.