Class WindowConverter
- java.lang.Object
-
- org.deeplearning4j.text.movingwindow.WindowConverter
-
public class WindowConverter extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.nd4j.linalg.api.ndarray.INDArray
asExampleArray(Window window, Word2Vec vec, boolean normalize)
Converts a window (each word in the window) in to a vector.static org.nd4j.linalg.api.ndarray.INDArray
asExampleMatrix(Window window, Word2Vec vec)
Converts a window (each word in the window) in to a vector.
-
-
-
Method Detail
-
asExampleArray
public static org.nd4j.linalg.api.ndarray.INDArray asExampleArray(Window window, Word2Vec vec, boolean normalize)
Converts a window (each word in the window) in to a vector. Keep in mind each window is a multi word context. From there, each word uses the passed in model as a lookup table to get what vectors are relevant to the passed in windows- Parameters:
window
- the window to take in.vec
- the model to use as a lookup table- Returns:
- a concacneated 1 row array containing all of the numbers for each word in the window
-
asExampleMatrix
public static org.nd4j.linalg.api.ndarray.INDArray asExampleMatrix(Window window, Word2Vec vec)
Converts a window (each word in the window) in to a vector. Keep in mind each window is a multi word context. From there, each word uses the passed in model as a lookup table to get what vectors are relevant to the passed in windows- Parameters:
window
- the window to take in.vec
- the model to use as a lookup table- Returns:
- a concatneated 1 row array containing all of the numbers for each word in the window
-
-