public final class Word2Vec extends Estimator<Word2VecModel>
Map(String, Vector)
, i.e. transforms a word into a code for further
natural language processing or machine learning process.Constructor and Description |
---|
Word2Vec() |
Word2Vec(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
Word2Vec |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
Word2VecModel |
fit(DataFrame dataset)
Fits a model to the input data.
|
java.lang.String |
getInputCol() |
int |
getMaxIter() |
int |
getMinCount() |
int |
getNumPartitions() |
java.lang.String |
getOutputCol() |
long |
getSeed() |
double |
getStepSize() |
int |
getVectorSize() |
int |
getWindowSize() |
Param<java.lang.String> |
inputCol()
Param for input column name.
|
static Word2Vec |
load(java.lang.String path) |
IntParam |
maxIter()
Param for maximum number of iterations (>= 0).
|
IntParam |
minCount()
The minimum number of times a token must appear to be included in the word2vec model's
vocabulary.
|
IntParam |
numPartitions()
Number of partitions for sentences of words.
|
Param<java.lang.String> |
outputCol()
Param for output column name.
|
LongParam |
seed()
Param for random seed.
|
Word2Vec |
setInputCol(java.lang.String value) |
Word2Vec |
setMaxIter(int value) |
Word2Vec |
setMinCount(int value) |
Word2Vec |
setNumPartitions(int value) |
Word2Vec |
setOutputCol(java.lang.String value) |
Word2Vec |
setSeed(long value) |
Word2Vec |
setStepSize(double value) |
Word2Vec |
setVectorSize(int value) |
Word2Vec |
setWindowSize(int value) |
DoubleParam |
stepSize()
Param for Step size to be used for each iteration of optimization..
|
StructType |
transformSchema(StructType schema)
:: DeveloperApi ::
|
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
StructType |
validateAndTransformSchema(StructType schema)
Validate and transform the input schema.
|
IntParam |
vectorSize()
The dimension of the code that you want to transform from words.
|
IntParam |
windowSize()
The window size (context words from [-window, window]) default 5.
|
transformSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public static Word2Vec load(java.lang.String path)
public java.lang.String uid()
Identifiable
uid
in interface Identifiable
public Word2Vec setInputCol(java.lang.String value)
public Word2Vec setOutputCol(java.lang.String value)
public Word2Vec setVectorSize(int value)
public Word2Vec setWindowSize(int value)
public Word2Vec setStepSize(double value)
public Word2Vec setNumPartitions(int value)
public Word2Vec setMaxIter(int value)
public Word2Vec setSeed(long value)
public Word2Vec setMinCount(int value)
public Word2VecModel fit(DataFrame dataset)
Estimator
fit
in class Estimator<Word2VecModel>
dataset
- (undocumented)public StructType transformSchema(StructType schema)
PipelineStage
Derives the output schema from the input schema.
transformSchema
in class PipelineStage
schema
- (undocumented)public Word2Vec copy(ParamMap extra)
Params
copy
in interface Params
copy
in class Estimator<Word2VecModel>
extra
- (undocumented)defaultCopy()
public IntParam vectorSize()
public int getVectorSize()
public IntParam windowSize()
public int getWindowSize()
public IntParam numPartitions()
public int getNumPartitions()
public IntParam minCount()
public int getMinCount()
public StructType validateAndTransformSchema(StructType schema)
schema
- (undocumented)public Param<java.lang.String> inputCol()
public java.lang.String getInputCol()
public Param<java.lang.String> outputCol()
public java.lang.String getOutputCol()
public IntParam maxIter()
public int getMaxIter()
public DoubleParam stepSize()
public double getStepSize()
public LongParam seed()
public long getSeed()