embeddings.load_word2vec_embeddings

pai4sk.simsearch.embeddings.load_word2vec_embeddings(embedding_file_path, vectors_file_path='vectors.npy', vocabulary_file_path='vocabulary.txt')

Loads Word2Vec word-embedding vectors and vocabulary from embedding_file_path Saves the vectors into vectors_file_path in .npy format Saves the vocabulary into vocabulary_file_path in .txt format

Parameters
  • embedding_file_path (string) – Indicates the absolute file path location for the embeddings file

  • vectors_file_path (string (default="vectors.npy")) – Indicates the absolute file path location for storing the output vectors.npy file

  • vocabulary_file_path (string (default="vocabulary.txt")) – Indicates the absolute file path location for storing the output vocabulary.txt file

Returns

W – Embedding vectors

Return type

array-like, shape (n_features, n_dimensions)