MulaiMulai sekarang secara gratis

Inspecting word vectors

In this exercise, you'll use a larger English model, which includes around 20.000 word vectors. Because vectors take a little longer to load, we're using a slightly compressed version of it than the one you can download with spaCy. The model is already pre-installed, and spacy has already been imported for you.

Latihan ini adalah bagian dari kursus

Advanced NLP with spaCy

Lihat Kursus

Petunjuk latihan

  • Load the medium 'en_core_web_md' model with word vectors.
  • Print the vector for "bananas" using the token.vector attribute.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Load the en_core_web_md model
nlp = ____

# Process a text
doc = nlp("Two bananas in pyjamas")

# Get the vector for the token "bananas"
bananas_vector = ____.____
print(bananas_vector)
Edit dan Jalankan Kode