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, workerslayerSize, 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, trainSentenceaccuracy, getWordVector, getWordVectorMatrix, getWordVectorMatrixNormalized, hasWord, indexOf, lookupTable, setLookupTable, setVocab, similarity, similarWordsInVocabTo, vocab, wordsNearest, wordsNearest, wordsNearestSum, wordsNearestSumprotected Queue<LinkedList<Pair<List<VocabWord>,Collection<VocabWord>>>> jobQueue
public void fit()
throws IOException
fit in class Word2VecIOExceptionpublic 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.