<jupyter_start><jupyter_text>Retrieve the learned embeddingsNext, let's retrieve the word embeddings learned during training. This will be a matrix of shape `(vocab_size,embedding-dimension)`.<jupyter_code>embed_list = []
for word in vocabulary:
    embed_list.append(model.wv[word].tolist())
print("Size vocabulary",len(embed_list))
print("Embedding dimensions",len(embed_list[0]))
embeddings = np.array(embed_list)
print(embeddings.shape)
embeddings[0]<jupyter_output><empty_output><jupyter_text>Visualize Embeddings We will now write the weights to disk. To use the [Embedding Projector](http://projector.tensorflow.org), we will upload two files in tab separated format: a file of vectors (containing the embedding), and a file of meta data (containing the words).<jupyter_code>import io

out_v = io.open('/Users/cankutcoskun/Desktop/ChatBotProject/tsvFiles/vecs.tsv', 'w', encoding='utf-8')
out_m = io.open('/Users/cankutcoskun/Desktop/ChatBotProject/tsvFiles/meta.tsv', 'w', encoding='utf-8')

for idx in range(len(vocabulary)):
    word = vocabulary[idx]
    #print(word)
    weights = embeddings[idx]
    #print(weights)
    #print(len(weights))
    out_m.write(word + "\n")
    out_v.write('\t'.join([str(w) for w in weights]) + "\n")
    
out_v.close()
out_m.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1362940275650842, 'fraction_numerical': 0.0030627871362940277, 'mean_word_length': 5.878947368421053, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '127660', 'license': 'Apache-2.0', 'n_tokens_mistral': 453, 'n_tokens_neox': 439, 'n_words': 102, 'path': '.ipynb_checkpoints/word2Vec_Gensim-checkpoint.ipynb', 'repo_name': 'CankutCoskun/semanticQuestionAnswerBot', 'size': '1306'}