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

Dependency parsing with spaCy

Dependency parsing analyzes the grammatical structure in a sentence and finds out related words as well as the type of relationship between them. An application of dependency parsing is to identify a sentence object and subject. In this exercise, you will practice extracting dependency labels for given texts.

Three comments from the Airline Travel Information System (ATIS) dataset have been provided for you in a list called texts. en_core_web_sm model is already loaded and available for your use as nlp.

Bu egzersiz

Natural Language Processing with spaCy

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

Egzersiz talimatları

  • Create a documents list containing the doc containers of each element in the texts list.
  • Print a tuple of (the token's text, dependency label, and label's explanation) per each doc container.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a list of Doc containts of texts list
documents = [____ for t in ____]

# Print each token's text, dependency label and its explanation
for doc in documents:
    print([(token.____, token.____, spacy.____(token.____)) for token in doc], "\n")
Kodu Düzenle ve Çalıştır