CommencerCommencez gratuitement

Traitement sélectif

Dans cet exercice, vous allez utiliser les méthodes nlp.make_doc et nlp.disable_pipes pour n’exécuter que certains composants lors du traitement d’un texte. Le petit modèle anglais est déjà chargé dans l’objet nlp.

Cet exercice fait partie du cours

<cours>NLP avancé avec spaCy</cours>
Voir le cours

Exercice interactif pratique

Essayez cet exercice en complétant ce code d’exemple.

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])
Modifier et exécuter le code