protected static class MalletLdaWrapper.MalletLDATopicModeler
extends cc.mallet.topics.ParallelTopicModel
implements org.dice_research.topicmodeling.algorithms.LDAModel
| Modifier and Type | Field and Description |
|---|---|
protected MalletLdaInferenceWrapper |
inferencer |
protected int |
inferencerVersion |
protected int |
iteration |
protected static org.slf4j.Logger |
logger |
protected cc.mallet.topics.WorkerRunnable[] |
runnables |
private static long |
serialVersionUID |
protected double[] |
topicWeights |
protected org.dice_research.topicmodeling.utils.vocabulary.Vocabulary |
vocabulary |
protected double[][] |
wordTopicWeights |
alpha, alphabet, alphaSum, beta, betaSum, burninPeriod, data, DEFAULT_BETA, docLengthCounts, formatter, modelFilename, numIterations, numTopics, numTypes, optimizeInterval, printLogLikelihood, randomSeed, saveModelInterval, saveSampleInterval, saveStateInterval, showTopicsInterval, stateFilename, temperingInterval, tokensPerTopic, topicAlphabet, topicBits, topicDocCounts, topicMask, totalTokens, typeTopicCounts, UNASSIGNED_TOPIC, usingSymmetricAlpha, wordsPerTopic| Constructor and Description |
|---|
MalletLDATopicModeler(int numberOfTopics,
double alphaSum,
double beta,
long seed) |
MalletLDATopicModeler(int numberOfTopics,
long seed) |
MalletLDATopicModeler(cc.mallet.types.LabelAlphabet topicAlphabet,
double alphaSum,
double beta,
long seed) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateSmoothedWeights() |
void |
estimate() |
double[] |
getAlphas() |
double |
getBeta() |
org.dice_research.topicmodeling.utils.doc.DocumentClassificationResult |
getClassificationForDocument(org.dice_research.topicmodeling.utils.doc.Document document) |
cc.mallet.topics.TopicInferencer |
getInferencer() |
int |
getNumberOfTopics() |
double |
getProbabilityOfWord(int wordId,
int topicId) |
double |
getSmoothedProbabilityOfTopic(int topicId) |
double |
getSmoothedProbabilityOfWord(int wordId,
int topicId) |
double[] |
getTopicProbabilitiesForDocument(org.dice_research.topicmodeling.utils.doc.DocumentWordCounts wordCounts) |
int |
getVersion() |
org.dice_research.topicmodeling.utils.vocabulary.Vocabulary |
getVocabulary() |
org.dice_research.topicmodeling.utils.vocabulary.VocabularyMapping |
getVocabularyMapping(org.dice_research.topicmodeling.utils.vocabulary.Vocabulary otherVocabulary) |
int[] |
inferTopicAssignmentsForDocument(org.dice_research.topicmodeling.utils.doc.Document document) |
int[] |
inferTopicAssignmentsForDocument(org.dice_research.topicmodeling.utils.doc.DocumentWordCounts wordCounts) |
int[] |
inferTopicAssignmentsForDocument(int[] tokens) |
void |
initialize(cc.mallet.types.InstanceList instances) |
void |
setVersion(int version) |
void |
setVocabularyDecorator(org.dice_research.topicmodeling.utils.vocabulary.VocabularyDecorator vocabulary) |
addInstances, buildInitialTypeTopicCounts, displayTopWords, getAlphabet, getData, getNumTopics, getProbEstimator, getSortedWords, getTopicAlphabet, getTopicProbabilities, getTopicProbabilities, getTopWords, initializeFromState, main, modelLogLikelihood, optimizeAlpha, optimizeBeta, printDocumentTopics, printDocumentTopics, printDocumentTopics, printState, printState, printTopicWordWeights, printTopicWordWeights, printTopWords, printTopWords, printTypeTopicCounts, read, setBurninPeriod, setNumIterations, setNumThreads, setOptimizeInterval, setRandomSeed, setSaveSerializedModel, setSaveState, setSymmetricAlpha, setTemperingInterval, setTopicDisplay, sumTypeTopicCounts, temperAlpha, topicPhraseXMLReport, topicXMLReport, writeprivate static final long serialVersionUID
protected static final org.slf4j.Logger logger
protected transient cc.mallet.topics.WorkerRunnable[] runnables
protected int iteration
protected transient int inferencerVersion
protected transient MalletLdaInferenceWrapper inferencer
protected org.dice_research.topicmodeling.utils.vocabulary.Vocabulary vocabulary
protected double[][] wordTopicWeights
protected double[] topicWeights
public MalletLDATopicModeler(int numberOfTopics,
long seed)
public MalletLDATopicModeler(int numberOfTopics,
double alphaSum,
double beta,
long seed)
public MalletLDATopicModeler(cc.mallet.types.LabelAlphabet topicAlphabet,
double alphaSum,
double beta,
long seed)
public void initialize(cc.mallet.types.InstanceList instances)
public void estimate()
estimate in class cc.mallet.topics.ParallelTopicModelpublic double getSmoothedProbabilityOfWord(int wordId,
int topicId)
getSmoothedProbabilityOfWord in interface org.dice_research.topicmodeling.algorithms.ProbabilisticWordTopicModelpublic double getProbabilityOfWord(int wordId,
int topicId)
getProbabilityOfWord in interface org.dice_research.topicmodeling.algorithms.ProbabilisticWordTopicModelpublic double getSmoothedProbabilityOfTopic(int topicId)
getSmoothedProbabilityOfTopic in interface org.dice_research.topicmodeling.algorithms.ProbabilisticWordTopicModelpublic int getNumberOfTopics()
getNumberOfTopics in interface org.dice_research.topicmodeling.algorithms.ProbabilisticWordTopicModelprotected void calculateSmoothedWeights()
public double[] getTopicProbabilitiesForDocument(org.dice_research.topicmodeling.utils.doc.DocumentWordCounts wordCounts)
getTopicProbabilitiesForDocument in interface org.dice_research.topicmodeling.algorithms.ProbabilisticWordTopicModelpublic org.dice_research.topicmodeling.utils.vocabulary.Vocabulary getVocabulary()
getVocabulary in interface org.dice_research.topicmodeling.algorithms.VocabularyContainingpublic cc.mallet.topics.TopicInferencer getInferencer()
getInferencer in class cc.mallet.topics.ParallelTopicModelpublic void setVocabularyDecorator(org.dice_research.topicmodeling.utils.vocabulary.VocabularyDecorator vocabulary)
public void setVersion(int version)
setVersion in interface org.dice_research.topicmodeling.algorithms.Modelpublic int getVersion()
getVersion in interface org.dice_research.topicmodeling.algorithms.Modelpublic org.dice_research.topicmodeling.utils.vocabulary.VocabularyMapping getVocabularyMapping(org.dice_research.topicmodeling.utils.vocabulary.Vocabulary otherVocabulary)
getVocabularyMapping in interface org.dice_research.topicmodeling.algorithms.VocabularyContainingModelpublic org.dice_research.topicmodeling.utils.doc.DocumentClassificationResult getClassificationForDocument(org.dice_research.topicmodeling.utils.doc.Document document)
getClassificationForDocument in interface org.dice_research.topicmodeling.algorithms.ClassificationModelpublic int[] inferTopicAssignmentsForDocument(org.dice_research.topicmodeling.utils.doc.Document document)
inferTopicAssignmentsForDocument in interface org.dice_research.topicmodeling.algorithms.LDAModelpublic int[] inferTopicAssignmentsForDocument(org.dice_research.topicmodeling.utils.doc.DocumentWordCounts wordCounts)
inferTopicAssignmentsForDocument in interface org.dice_research.topicmodeling.algorithms.LDAModelpublic int[] inferTopicAssignmentsForDocument(int[] tokens)
inferTopicAssignmentsForDocument in interface org.dice_research.topicmodeling.algorithms.LDAModelpublic double getBeta()
getBeta in interface org.dice_research.topicmodeling.algorithms.LDAModelpublic double[] getAlphas()
getAlphas in interface org.dice_research.topicmodeling.algorithms.LDAModelCopyright © 2015–2020. All rights reserved.