Class: Word2VecModel

eclairjs/mllib/feature.Word2VecModel

new Word2VecModel(model) → (nullable) {?}

Parameters:
Name Type Description
model Map
Source:
Returns:
Type
?

Methods

(static) load(sc, path) → {module:eclairjs/mllib/feature.Word2VecModel}

Parameters:
Name Type Description
sc module:eclairjs.SparkContext
path string
Source:
Returns:
Type
module:eclairjs/mllib/feature.Word2VecModel

findSynonyms(word, num) → {Array.<Tuple2>}

Find synonyms of a word
Parameters:
Name Type Description
word Vector | string a word
num number number of synonyms to find
Source:
Returns:
array of (word, cosineSimilarity)
Type
Array.<Tuple2>

getVectors() → {Map}

Returns a map of words to their vector representations.
Source:
Returns:
Type
Map

save(sc, path) → {Promise.<Void>}

Parameters:
Name Type Description
sc module:eclairjs.SparkContext
path string
Source:
Returns:
A Promise that resolves to nothing.
Type
Promise.<Void>

transform(word) → {module:eclairjs/mllib/linalg.Vector}

Transforms a word to its vector representation
Parameters:
Name Type Description
word string a word
Source:
Returns:
vector representation of word
Type
module:eclairjs/mllib/linalg.Vector