dragon.ir.topicmodel
Class AbstractTopicModel

java.lang.Object
  |
  +--dragon.ir.topicmodel.AbstractModel
        |
        +--dragon.ir.topicmodel.AbstractTopicModel
All Implemented Interfaces:
TopicModel
Direct Known Subclasses:
AspectModel, GibbsLDA, SimpleMixtureModel

public abstract class AbstractTopicModel
extends AbstractModel
implements TopicModel

Abstract class of topic model

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  double[][] arrDocTheme
           
protected  double[][] arrThemeTerm
           
protected  int docNum
           
protected  IndexReader indexReader
           
protected  int termNum
           
protected  int themeNum
           
 
Fields inherited from class dragon.ir.topicmodel.AbstractModel
iterations, seed, statusOut
 
Constructor Summary
AbstractTopicModel(IndexReader indexReader)
           
 
Method Summary
 int getDocNum()
           
 double[] getDocTopics(int docIndex)
           
 java.lang.String getTermName(int termIndex)
           
 int getTermNum()
           
 double[] getTopic(int topicIndex)
           
 int getTopicNum()
           
 
Methods inherited from class dragon.ir.topicmodel.AbstractModel
getBkgModel, getIterationNum, printStatus, setIterationNum, setRandomSeed, setStatusOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dragon.ir.topicmodel.TopicModel
estimateModel
 

Field Detail

themeNum

protected int themeNum

termNum

protected int termNum

docNum

protected int docNum

arrThemeTerm

protected double[][] arrThemeTerm

arrDocTheme

protected double[][] arrDocTheme

indexReader

protected IndexReader indexReader
Constructor Detail

AbstractTopicModel

public AbstractTopicModel(IndexReader indexReader)
Method Detail

getTopicNum

public int getTopicNum()
Specified by:
getTopicNum in interface TopicModel

getTopic

public double[] getTopic(int topicIndex)
Specified by:
getTopic in interface TopicModel
Parameters:
topicIndex - the index of the topic
Returns:
the distribution (over words) of the given topic

getDocNum

public int getDocNum()
Specified by:
getDocNum in interface TopicModel
Returns:
the number of documents

getDocTopics

public double[] getDocTopics(int docIndex)
Specified by:
getDocTopics in interface TopicModel
Parameters:
docIndex - the index of the document
Returns:
the distribution (over topics) of the given document

getTermNum

public int getTermNum()
Specified by:
getTermNum in interface TopicModel
Returns:
the number of topical terms

getTermName

public java.lang.String getTermName(int termIndex)
Specified by:
getTermName in interface TopicModel
Parameters:
termIndex - the index of the topical term
Returns:
the name of the given topical term