LoslegenKostenlos loslegen

Docs, spans and entities from scratch

In this exercise, you'll create the Doc and Span objects manually, and update the named entities – just like spaCy does behind the scenes. A shared nlp object has already been created.

Diese Übung ist Teil des Kurses

Advanced NLP with spaCy

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Import the Doc and Span classes
from spacy.____ import ____, ____

words = ['I', 'like', 'David', 'Bowie']
spaces = [True, True, True, False]

# Create a doc from the words and spaces
doc = ____(____, ____, ____)
print(doc.text)
Code bearbeiten und ausführen