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 Set<VectorsListener<T>> |
eventListeners |
protected WordVectors |
existingModel |
protected WordVectors |
intersectModel |
protected SequenceIterator<T> |
iterator |
protected boolean |
lockFactor |
protected static org.slf4j.Logger |
log |
protected org.nd4j.shade.guava.util.concurrent.AtomicDouble |
scoreElements |
protected org.nd4j.shade.guava.util.concurrent.AtomicDouble |
scoreSequences |
protected SequenceLearningAlgorithm<T> |
sequenceLearningAlgorithm |
protected T |
unknownElement |
protected int |
vocabLimit |
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() |
String |
getUNK() |
org.nd4j.linalg.api.ndarray.INDArray |
getWordVectorMatrix(String word)
Get the word vector for a given matrix
|
protected void |
initLearners() |
void |
setUNK(String UNK) |
protected void |
trainSequence(@NonNull Sequence<T> sequence,
AtomicLong nextRandom,
double alpha) |
accuracy, getLayerSize, getWordVector, getWordVectorMatrixNormalized, getWordVectors, getWordVectorsMean, hasWord, indexOf, jsonSerializable, loadWeightsInto, lookupTable, outOfVocabularySupported, setLookupTable, setModelUtils, setVocab, similarity, similarWordsInVocabTo, update, update, vectorSize, vocab, vocabSize, wordsNearest, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSumclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccuracy, getWordVector, getWordVectorMatrixNormalized, getWordVectors, getWordVectorsMean, hasWord, indexOf, lookupTable, outOfVocabularySupported, setModelUtils, similarity, similarWordsInVocabTo, vocab, wordsNearest, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSumjsonSerializable, loadWeightsInto, vectorSize, vocabSizeprotected 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 WordVectors intersectModel
protected transient T extends SequenceElement unknownElement
protected transient org.nd4j.shade.guava.util.concurrent.AtomicDouble scoreElements
protected transient org.nd4j.shade.guava.util.concurrent.AtomicDouble scoreSequences
protected transient boolean configured
protected transient boolean lockFactor
protected boolean enableScavenger
protected int vocabLimit
protected transient Set<VectorsListener<T extends SequenceElement>> eventListeners
public String getUNK()
getUNK in interface WordVectorspublic void setUNK(String UNK)
setUNK in interface WordVectorspublic double getElementsScore()
public double getSequencesScore()
public org.nd4j.linalg.api.ndarray.INDArray getWordVectorMatrix(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()
protected void trainSequence(@NonNull
@NonNull Sequence<T> sequence,
AtomicLong nextRandom,
double alpha)
Copyright © 2022. All rights reserved.