BaşlayınÜcretsiz Başlayın

Tokenization with spaCy

In this exercise, you'll practice tokenizing text. You'll use the first review from the Amazon Fine Food Reviews dataset for this exercise. You can access this review by using the text object provided.

The en_core_web_sm model is already loaded for you. You can access it by calling nlp(). You can use list comprehension to compile output lists.

Bu egzersiz

Natural Language Processing with spaCy

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Store Doc container for the pre-loaded review in a document object.
  • Store and review texts of all the tokens of the document in the variable first_text_tokens.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a Doc container of the given text
document = ____(____)
    
# Store and review the token text values of tokens for the Doc container
first_text_tokens = [____ for ____ in ____]
print("First text tokens:\n", first_text_tokens, "\n")
Kodu Düzenle ve Çalıştır