new Word2VecModel()
Model fitted by module:eclairjs/ml/feature.Word2Vec.
Extends
Methods
(static) load(path) → {module:eclairjs/ml/feature.Word2VecModel}
Parameters:
Name | Type | Description |
---|---|---|
path |
string |
Returns:
(static) read() → {module:eclairjs/ml/util.MLReader}
Returns:
copy(extra) → {module:eclairjs/ml/feature.Word2VecModel}
Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly.
Parameters:
Name | Type | Description |
---|---|---|
extra |
module:eclairjs/ml/param.ParamMap |
- Overrides:
- Source:
Returns:
findSynonyms(word, num) → {module:eclairjs/sql.Dataset}
Find "num" number of words closest in similarity to the given word or vector representation.
Returns a Dataset with the words and the cosine similarities between the
synonyms and the given word.
Parameters:
Name | Type | Description |
---|---|---|
word |
string | module:eclairjs/mllib/linalg.Vector | |
num |
integer |
Returns:
getInputCol() → {string}
Returns:
- Type
- string
getMaxIter() → {integer}
Returns:
- Type
- integer
getMinCount() → {integer}
Returns:
- Type
- integer
getNumPartitions() → {integer}
Returns:
- Type
- integer
getOutputCol() → {string}
Returns:
- Type
- string
getSeed() → {integer}
Returns:
- Type
- integer
getStepSize() → {float}
Returns:
- Type
- float
getVectors() → {module:eclairjs/sql.Dataset}
Returns a Dataset with two fields, "word" and "vector", with "word" being a String and and the vector the DenseVector that it is mapped to.
Returns:
getVectorSize() → {integer}
Returns:
- Type
- integer
getWindowSize() → {integer}
Returns:
- Type
- integer
hasParent() → {boolean}
- Inherited From:
- Source:
Returns:
- Type
- boolean
inputCol() → {module:eclairjs/ml/param.Param}
Returns:
maxIter() → {module:eclairjs/ml/param.IntParam}
Param for maximum number of iterations (>= 0).
Returns:
minCount() → {module:eclairjs/ml/param.IntParam}
The minimum number of times a token must appear to be included in the word2vec model's vocabulary. Default: 5
Returns:
numPartitions() → {module:eclairjs/ml/param.IntParam}
Number of partitions for sentences of words. Default: 1
Returns:
outputCol() → {module:eclairjs/ml/param.Param}
Returns:
parent() → {module:eclairjs/ml.Estimator}
- Inherited From:
- Source:
Returns:
seed() → {module:eclairjs/ml/param.LongParam}
Param for random seed.
Returns:
- Type
- module:eclairjs/ml/param.LongParam
setInputCol(value) → {module:eclairjs/ml/feature.Word2VecModel}
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
Returns:
setOutputCol(value) → {module:eclairjs/ml/feature.Word2VecModel}
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
Returns:
setParent(parent) → {object}
Sets the parent of this model.
Parameters:
Name | Type | Description |
---|---|---|
parent |
module:eclairjs/ml.Estimator |
- Inherited From:
- Source:
Returns:
- Type
- object
stepSize() → {module:eclairjs/ml/param.DoubleParam}
Param for Step size to be used for each iteration of optimization
Returns:
transform(dataset) → {module:eclairjs/sql.Dataset}
Transform a sentence column to a vector column to represent the whole sentence. The transform
is performed by averaging all word vectors it contains.
Parameters:
Name | Type | Description |
---|---|---|
dataset |
module:eclairjs/sql.Dataset |
- Overrides:
- Source:
Returns:
transformSchema(schema) → {module:eclairjs/sql/types.StructType}
Derives the output schema from the input schema.
Parameters:
Name | Type | Description |
---|---|---|
schema |
module:eclairjs/sql/types.StructType |
- Overrides:
- Source:
Returns:
uid() → {string}
An immutable unique ID for the object and its derivatives.
Returns:
- Type
- string
validateAndTransformSchema(schema) → {module:eclairjs/sql/types.StructType}
Validates and transforms the input schema.
Parameters:
Name | Type | Description |
---|---|---|
schema |
module:eclairjs/sql/types.StructType |
Returns:
vectorSize() → {module:eclairjs/ml/param.IntParam}
The dimension of the code that you want to transform from words. Default: 100
Returns:
windowSize() → {module:eclairjs/ml/param.IntParam}
The window size (context words from [-window, window]) default 5.