pyeeg.io.get_word_vectors

pyeeg.io.get_word_vectors(wordlist, wordvectors, unk='skip')

Get the word vectors for each word in the list supplied. Words that do not appear in the Word Vector model can be either skipped or assign a random value, or try to process them to find a close relative.

Parameters:
  • wordlist (list) – List word for which we should find the corresponding vectors

  • wordvectors (gensim.models.KeyedVectors) – Gensim’s word embedding model

  • unk (str ({'skip', 'rdm', 'closest'})) – Method used for words that do not appear in the word embedding vocabulary

Returns:

wordvecs

Return type:

ndarray (nwords, ndims)