word_embedding_loader.saver package¶
loader module provides actual implementation of the file savers.
Warning
This is an internal implementation. API may change without
notice in the future, so you should use
word_embedding_loader.word_embedding.WordEmbedding
Submodules¶
word_embedding_loader.saver.glove module¶
Low level API for saving of word embedding file that was implemented in GloVe, Global Vectors for Word Representation, by Jeffrey Pennington, Richard Socher, Christopher D. Manning from Stanford NLP group.
-
word_embedding_loader.saver.glove.
save
(f, arr, vocab)¶ Save word embedding file.
Parameters: - f (File) – File to write the vectors. File should be open for writing ascii.
- arr (numpy.array) – Numpy array with
float
dtype. - vocab (iterable) – Each element is pair of a word (
bytes
) andarr
index (int
). Word should be encoded to str apriori.
word_embedding_loader.saver.word2vec_bin module¶
Low level API for loading of word embedding file that was implemented in
word2vec, by Mikolov.
This implementation is for word embedding file created with -binary 1
option.
-
word_embedding_loader.saver.word2vec_bin.
save
()¶ Refer to
word_embedding_loader.saver.glove.save()
for the API.
word_embedding_loader.saver.word2vec_text module¶
Low level API for saving of word embedding file that was implemented in
word2vec, by Mikolov.
This implementation is for word embedding file created with -binary 0
option (the default).
-
word_embedding_loader.saver.word2vec_text.
save
(f, arr, vocab)¶ Save word embedding file. Check
word_embedding_loader.saver.glove.save()
for the API.