public class SequenceVectors<T extends SequenceElement> extends WordVectorsImpl<T> implements WordVectors
| Modifier and Type | Class and Description |
|---|---|
protected class |
SequenceVectors.AsyncSequencer
This class is used to fetch data from iterator in background thread, and convert it to List
|
static class |
SequenceVectors.Builder<T extends SequenceElement> |
| Modifier and Type | Field and Description |
|---|---|
protected VectorsConfiguration |
configuration |
protected boolean |
configured |
protected ElementsLearningAlgorithm<T> |
elementsLearningAlgorithm |
protected boolean |
enableScavenger |
protected java.util.Set<VectorsListener<T>> |
eventListeners |
protected WordVectors |
existingModel |
protected SequenceIterator<T> |
iterator |
protected static org.slf4j.Logger |
log |
protected com.google.common.util.concurrent.AtomicDouble |
scoreElements |
protected com.google.common.util.concurrent.AtomicDouble |
scoreSequences |
protected SequenceLearningAlgorithm<T> |
sequenceLearningAlgorithm |
protected T |
unknownElement |
batchSize, DEFAULT_UNK, layerSize, learningRate, learningRateDecayWords, lookupTable, minLearningRate, minWordFrequency, modelUtils, negative, numEpochs, numIterations, resetModel, sampling, seed, stopWords, trainElementsVectors, trainSequenceVectors, useAdeGrad, useUnknown, variableWindows, vocab, window, workers| Constructor and Description |
|---|
SequenceVectors() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildVocab()
Builds vocabulary from provided SequenceIterator instance
|
void |
fit()
Starts training over
|
double |
getElementsScore() |
double |
getSequencesScore() |
java.lang.String |
getUNK() |
org.nd4j.linalg.api.ndarray.INDArray |
getWordVectorMatrix(java.lang.String word)
Get the word vector for a given matrix
|
protected void |
initLearners() |
protected void |
trainSequence(Sequence<T> sequence,
java.util.concurrent.atomic.AtomicLong nextRandom,
double alpha) |
accuracy, getLayerSize, getWordVector, getWordVectorMatrixNormalized, getWordVectors, getWordVectorsMean, hasWord, indexOf, lookupTable, setLookupTable, setModelUtils, setVocab, similarity, similarWordsInVocabTo, update, update, vocab, wordsNearest, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSumclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccuracy, getWordVector, getWordVectorMatrixNormalized, getWordVectors, getWordVectorsMean, hasWord, indexOf, lookupTable, setModelUtils, setUNK, similarity, similarWordsInVocabTo, vocab, wordsNearest, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSumprotected transient SequenceIterator<T extends SequenceElement> iterator
protected transient ElementsLearningAlgorithm<T extends SequenceElement> elementsLearningAlgorithm
protected transient SequenceLearningAlgorithm<T extends SequenceElement> sequenceLearningAlgorithm
protected VectorsConfiguration configuration
protected static final org.slf4j.Logger log
protected transient WordVectors existingModel
protected transient T extends SequenceElement unknownElement
protected transient com.google.common.util.concurrent.AtomicDouble scoreElements
protected transient com.google.common.util.concurrent.AtomicDouble scoreSequences
protected transient boolean configured
protected boolean enableScavenger
protected transient java.util.Set<VectorsListener<T extends SequenceElement>> eventListeners
public java.lang.String getUNK()
getUNK in interface WordVectorspublic double getElementsScore()
public double getSequencesScore()
public org.nd4j.linalg.api.ndarray.INDArray getWordVectorMatrix(java.lang.String word)
WordVectorsgetWordVectorMatrix in interface WordVectorsgetWordVectorMatrix in class WordVectorsImpl<T extends SequenceElement>word - the word to get the matrix forpublic void buildVocab()
protected void initLearners()
public void fit()