Package cc.mallet.topics
Class DMRTopicModel
- java.lang.Object
-
- cc.mallet.topics.ParallelTopicModel
-
- cc.mallet.topics.DMRTopicModel
-
- All Implemented Interfaces:
java.io.Serializable
public class DMRTopicModel extends ParallelTopicModel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
parametersFilename
int
saveParametersInterval
-
Fields inherited from class cc.mallet.topics.ParallelTopicModel
alpha, alphabet, alphaSum, beta, betaSum, burninPeriod, data, DEFAULT_BETA, docLengthCounts, formatter, logger, 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 Summary
Constructors Constructor Description DMRTopicModel(int numberOfTopics)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInstances(InstanceList training)
void
cacheAlphas(Instance instance, int docIndex)
Set alpha based on features in an instancevoid
estimate()
MaxEnt
getDmrParameters()
DMRInferencer
getInferencer()
Return a tool for estimating topic distributions for new documentsvoid
learnParameters()
static void
main(java.lang.String[] args)
double
modelLogLikelihood()
void
printTopWords(java.io.PrintStream out, int numWords, boolean usingNewLines)
static DMRTopicModel
read(java.io.File f)
void
write(java.io.File serializedModelFile)
void
writeParameters(java.io.File parameterFile)
-
Methods inherited from class cc.mallet.topics.ParallelTopicModel
buildInitialTypeTopicCounts, displayTopWords, getAlphabet, getData, getDocumentTopics, getNumTopics, getProbEstimator, getSortedWords, getSubCorpusTopicWords, getTokensPerTopic, getTopicAlphabet, getTopicDocuments, getTopicProbabilities, getTopicProbabilities, getTopicWords, getTopWords, getTypeTopicCounts, initializeFromState, maximize, optimizeAlpha, optimizeBeta, printDenseDocumentTopics, printDocumentTopics, printDocumentTopics, printDocumentTopics, printState, printState, printTopicDocuments, printTopicDocuments, printTopicWordWeights, printTopicWordWeights, printTopWords, printTypeTopicCounts, setBurninPeriod, setNumIterations, setNumThreads, setNumTopics, setOptimizeInterval, setRandomSeed, setSaveSerializedModel, setSaveState, setSymmetricAlpha, setTemperingInterval, setTopicDisplay, temperAlpha, topicPhraseXMLReport, topicXMLReport
-
-
-
-
Method Detail
-
addInstances
public void addInstances(InstanceList training)
- Overrides:
addInstances
in classParallelTopicModel
-
estimate
public void estimate() throws java.io.IOException
- Overrides:
estimate
in classParallelTopicModel
- Throws:
java.io.IOException
-
cacheAlphas
public void cacheAlphas(Instance instance, int docIndex)
Set alpha based on features in an instance
-
learnParameters
public void learnParameters()
-
printTopWords
public void printTopWords(java.io.PrintStream out, int numWords, boolean usingNewLines)
- Overrides:
printTopWords
in classParallelTopicModel
-
writeParameters
public void writeParameters(java.io.File parameterFile) throws java.io.IOException
- Throws:
java.io.IOException
-
getDmrParameters
public MaxEnt getDmrParameters()
-
modelLogLikelihood
public double modelLogLikelihood()
- Overrides:
modelLogLikelihood
in classParallelTopicModel
-
getInferencer
public DMRInferencer getInferencer()
Return a tool for estimating topic distributions for new documents- Overrides:
getInferencer
in classParallelTopicModel
-
write
public void write(java.io.File serializedModelFile)
- Overrides:
write
in classParallelTopicModel
-
read
public static DMRTopicModel read(java.io.File f) throws java.lang.Exception
- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
-