Exercise

Documents, spans and tokens

When you call nlp on a string, spaCy first tokenizes the text and creates a document object. In this exercise, you'll learn more about the Doc, as well as its views Token and Span.

Instructions 1/2

undefined XP
    1
    2
  • Import the English language class and create the nlp object.
  • Process the text and instantiate a Doc object in the variable doc.
  • Select the first token of the Doc and print its text.