public class ParagraphVectors extends Word2Vec
Modifier and Type | Class and Description |
---|---|
static class |
ParagraphVectors.Builder |
Modifier and Type | Field and Description |
---|---|
protected Queue<LinkedList<Pair<List<VocabWord>,Collection<VocabWord>>>> |
jobQueue |
alpha, batchSize, docIter, g, invertedIndex, learningRateDecayWords, log, minLearningRate, numIterations, sample, saveVocab, seed, sentenceIter, serialVersionUID, shouldReset, tokenizerFactory, totalWords, UNK, useAdaGrad, vectorizer, window, workers
layerSize, lookupTable, minWordFrequency, stopWords, vocab
Constructor and Description |
---|
ParagraphVectors() |
Modifier and Type | Method and Description |
---|---|
protected void |
addWords(List<VocabWord> sentence,
AtomicLong nextRandom,
List<VocabWord> currMiniBatch) |
void |
dbow(int i,
Pair<List<VocabWord>,Collection<VocabWord>> sentenceWithLabel,
int b,
AtomicLong nextRandom,
double alpha)
Train the distributed bag of words
model
|
void |
fit()
Train the model
|
void |
trainSentence(Pair<List<VocabWord>,Collection<VocabWord>> sentenceWithLabel,
AtomicLong nextRandom,
double alpha)
Train on a list of vocab words
|
buildBinaryTree, buildVocab, getSentenceIter, getStopWords, getTokenizerFactory, getVectorizer, getWindow, iterate, readStopWords, resetWeights, resetWeightsOnSetup, setSentenceIter, setTokenizerFactory, setup, setVectorizer, skipGram, trainSentence
accuracy, getWordVector, getWordVectorMatrix, getWordVectorMatrixNormalized, hasWord, indexOf, lookupTable, setLookupTable, setVocab, similarity, similarWordsInVocabTo, vocab, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSum
protected Queue<LinkedList<Pair<List<VocabWord>,Collection<VocabWord>>>> jobQueue
public void fit() throws IOException
fit
in class Word2Vec
IOException
public void trainSentence(Pair<List<VocabWord>,Collection<VocabWord>> sentenceWithLabel, AtomicLong nextRandom, double alpha)
sentenceWithLabel
- the list of vocab words to train onpublic void dbow(int i, Pair<List<VocabWord>,Collection<VocabWord>> sentenceWithLabel, int b, AtomicLong nextRandom, double alpha)
i
- the word to trainsentenceWithLabel
- the sentence with labels to trainb
- nextRandom
- alpha
- Copyright © 2015. All rights reserved.