public class ParagraphVectors extends Word2Vec
Modifier and Type | Class and Description |
---|---|
static class |
ParagraphVectors.Builder |
SequenceVectors.AsyncSequencer
Modifier and Type | Field and Description |
---|---|
protected LabelAwareIterator |
labelAwareIterator |
protected List<VocabWord> |
labelsList |
protected org.nd4j.linalg.api.ndarray.INDArray |
labelsMatrix |
protected LabelsSource |
labelsSource |
protected boolean |
normalizedLabels |
sentenceIter, tokenizerFactory
configuration, configured, elementsLearningAlgorithm, eventListeners, existingModel, iterator, log, scoreElements, scoreSequences, sequenceLearningAlgorithm, 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 |
---|
ParagraphVectors() |
Modifier and Type | Method and Description |
---|---|
void |
extractLabels() |
void |
fit()
Starts training over
|
org.nd4j.linalg.api.ndarray.INDArray |
inferVector(LabelledDocument document)
This method calculates inferred vector for given document, with default parameters for learning rate and iterations
|
org.nd4j.linalg.api.ndarray.INDArray |
inferVector(LabelledDocument document,
double learningRate,
double minLearningRate,
int iterations)
This method calculates inferred vector for given document
|
org.nd4j.linalg.api.ndarray.INDArray |
inferVector(List<VocabWord> document)
This method calculates inferred vector for given list of words, with default parameters for learning rate and iterations
|
org.nd4j.linalg.api.ndarray.INDArray |
inferVector(List<VocabWord> document,
double learningRate,
double minLearningRate,
int iterations)
This method calculates inferred vector for given document
|
org.nd4j.linalg.api.ndarray.INDArray |
inferVector(String text)
This method calculates inferred vector for given text, with default parameters for learning rate and iterations
|
org.nd4j.linalg.api.ndarray.INDArray |
inferVector(String text,
double learningRate,
double minLearningRate,
int iterations)
This method calculates inferred vector for given text
|
Collection<String> |
nearestLabels(Collection<VocabWord> document,
int topN)
This method returns top N labels nearest to specified set of vocab words
|
Collection<String> |
nearestLabels(org.nd4j.linalg.api.ndarray.INDArray labelVector,
int topN)
This method returns top N labels nearest to specified features vector
|
Collection<String> |
nearestLabels(LabelledDocument document,
int topN)
This method returns top N labels nearest to specified document
|
Collection<String> |
nearestLabels(String rawText,
int topN)
This method returns top N labels nearest to specified text
|
String |
predict(LabelledDocument document)
Deprecated.
|
String |
predict(List<VocabWord> document)
Deprecated.
|
String |
predict(String rawText)
Deprecated.
|
Collection<String> |
predictSeveral(LabelledDocument document,
int limit)
Deprecated.
|
Collection<String> |
predictSeveral(List<VocabWord> document,
int limit)
Deprecated.
|
Collection<String> |
predictSeveral(String rawText,
int limit)
Deprecated.
|
double |
similarityToLabel(LabelledDocument document,
String label)
Deprecated.
|
double |
similarityToLabel(List<VocabWord> document,
String label)
Deprecated.
|
double |
similarityToLabel(String rawText,
String label)
Deprecated.
|
setSentenceIter, setTokenizerFactory
buildVocab, getElementsScore, getSequencesScore, initLearners, trainSequence
accuracy, getLayerSize, getWordVector, getWordVectorMatrix, getWordVectorMatrixNormalized, getWordVectors, getWordVectorsMean, hasWord, indexOf, lookupTable, setLookupTable, setModelUtils, setVocab, similarity, similarWordsInVocabTo, update, update, vocab, wordsNearest, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSum
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accuracy, getUNK, getWordVector, getWordVectorMatrix, getWordVectorMatrixNormalized, getWordVectors, getWordVectorsMean, hasWord, indexOf, lookupTable, setModelUtils, setUNK, similarity, similarWordsInVocabTo, vocab, wordsNearest, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSum
protected LabelsSource labelsSource
protected transient LabelAwareIterator labelAwareIterator
protected org.nd4j.linalg.api.ndarray.INDArray labelsMatrix
protected boolean normalizedLabels
@Deprecated public String predict(String rawText)
rawText
- @Deprecated public String predict(LabelledDocument document)
document
- the documentpublic void extractLabels()
public org.nd4j.linalg.api.ndarray.INDArray inferVector(String text, double learningRate, double minLearningRate, int iterations)
text
- public org.nd4j.linalg.api.ndarray.INDArray inferVector(LabelledDocument document, double learningRate, double minLearningRate, int iterations)
document
- public org.nd4j.linalg.api.ndarray.INDArray inferVector(List<VocabWord> document, double learningRate, double minLearningRate, int iterations)
document
- public org.nd4j.linalg.api.ndarray.INDArray inferVector(String text)
text
- public org.nd4j.linalg.api.ndarray.INDArray inferVector(LabelledDocument document)
document
- public org.nd4j.linalg.api.ndarray.INDArray inferVector(List<VocabWord> document)
document
- @Deprecated public String predict(List<VocabWord> document)
document
- the document@Deprecated public Collection<String> predictSeveral(@NonNull LabelledDocument document, int limit)
document
- raw text of the document@Deprecated public Collection<String> predictSeveral(String rawText, int limit)
rawText
- raw text of the document@Deprecated public Collection<String> predictSeveral(List<VocabWord> document, int limit)
document
- the documentpublic Collection<String> nearestLabels(LabelledDocument document, int topN)
document
- topN
- public Collection<String> nearestLabels(String rawText, int topN)
rawText
- topN
- public Collection<String> nearestLabels(Collection<VocabWord> document, int topN)
document
- topN
- public Collection<String> nearestLabels(org.nd4j.linalg.api.ndarray.INDArray labelVector, int topN)
labelVector
- topN
- @Deprecated public double similarityToLabel(String rawText, String label)
rawText
- label
- public void fit()
SequenceVectors
fit
in class SequenceVectors<VocabWord>
@Deprecated public double similarityToLabel(LabelledDocument document, String label)
document
- label
- @Deprecated public double similarityToLabel(List<VocabWord> document, String label)
document
- label
- Copyright © 2016. All Rights Reserved.