<jupyter_start><jupyter_text><jupyter_code>from google.colab import drive
drive.mount('/content/drive')
from gensim.models import KeyedVectors
# Load vectors directly from the file
model = KeyedVectors.load_word2vec_format('drive/My Drive/Pretrained_Word_Embeddings/GoogleNews-vectors-negative300.bin', binary=True)
# Access vectors for specific words with a keyed lookup:
vector = model['easy']
# see the shape of the vector (300,)
print(vector.shape)
# Processing sentences is not as simple as with Spacy:
vectors = [model[x] for x in "This is some text I am processing with Spacy".split(' ')]

#print(vectors)
import numpy as np

vectors = np.array(vectors)
print(vectors.shape)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10126582278481013, 'fraction_numerical': 0.009845288326300985, 'mean_word_length': 6.416666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '512468', 'license': 'Apache-2.0', 'n_tokens_mistral': 237, 'n_tokens_neox': 221, 'n_words': 69, 'path': 'demo/word2vec_pretrained_gensim.ipynb', 'repo_name': 'dhana-sekhar/Natural_Language_Processing', 'size': '711'}