शुरू करेंमुफ़्त में शुरू करें

spaCy vocabulary

Word vectors, या word embeddings (embedding — वेक्टर रूप में निरूपण), शब्दों के संख्यात्मक निरूपण होते हैं जिनसे कंप्यूटर टेक्स्ट डेटा पर जटिल काम कर पाते हैं. कई spaCy मॉडलों में word vectors शामिल होते हैं, हालाँकि कुछ मॉडलों में vectors नहीं होते.

इस अभ्यास में, आप spaCy vocabulary से जुड़ी जानकारी एक्सेस करना अभ्यास करेंगे. word vectors से संबंधित कुछ मेटा जानकारी हर spaCy मॉडल में स्टोर होती है. आप इस जानकारी से vocabulary का आकार, word vectors की dimensions आदि के बारे में जान सकते हैं.

spaCy पैकेज पहले से इम्पोर्ट किया गया है. किसी spaCy मॉडल के मेटाडेटा में, शब्दों की संख्या "vectors" key वाले एलिमेंट में स्टोर होती है और word vectors का dimension "width" key वाले एलिमेंट में स्टोर होता है.

यह अभ्यास पाठ्यक्रम का हिस्सा है

spaCy के साथ Natural Language Processing

पाठ्यक्रम देखें

अभ्यास निर्देश

  • en_core_web_md मॉडल लोड करें.
  • en_core_web_md मॉडल के vocabulary में शब्दों की संख्या प्रिंट करें.
  • en_core_web_md मॉडल में word vectors के dimensions प्रिंट करें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Load the en_core_web_md model
md_nlp = ____

# Print the number of words in the model's vocabulary
print("Number of words: ", md_nlp.____["vectors"]["vectors"], "\n")

# Print the dimensions of word vectors in en_core_web_md model
print("Dimension of word vectors: ", md_nlp.____["vectors"]["width"])
कोड संपादित करें और चलाएँ