Aan de slagGa gratis aan de slag

Selective processing

In this exercise, you'll use the nlp.make_doc and nlp.disable_pipes methods to only run selected components when processing a text. The small English model is already loaded in as the nlp object.

Deze oefening maakt deel uit van de cursus

Advanced NLP with spaCy

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

text = "Chick-fil-A is an American fast food restaurant chain headquartered in the city of College Park, Georgia, specializing in chicken sandwiches."

# Only tokenize the text
doc = nlp(text)

print([token.text for token in doc])
Code bewerken en uitvoeren