Search code examples
javaldatopic-modelingmallet

What is estimate function in topic modeling using mallet library


I'm new on topic modeling and I'm trying to use Mallet library but I have a question.

I'm using Simple parallel threaded implementation of LDA to find topics for some instances. My question is what is estimate function in ParallelTopicModel?

I have search in API but they have not description. Also I have read this tutorial.

Can someone explain what is this function?

EDIT

This is an example of my code:

 public void runModel(Sting [] str){    
    ParallelTopicModel model = new ParallelTopicModel(numTopics);
    ArrayList<Pipe> pipeList = new ArrayList<Pipe>();
    // Pipes: lowercase, tokenize, remove stopwords, map to features
    pipeList.add(new CharSequenceLowercase());
    pipeList.add(new CharSequence2TokenSequence(Pattern.compile("\\p{L}[\\p{L}\\p{P}]+\\p{L}")));
    pipeList.add(new TokenSequence2FeatureSequence());
    InstanceList instances = new InstanceList(new SerialPipes(pipeList));
    instances.addThruPipe(new StringArrayIterator(str));

     model.addInstances(instances);
     model.setNumThreads(THREADS);
     model.setOptimizeInterval(optimizeation);
     model.setBurninPeriod(burninInterval);
     model.setNumIterations(numIterations);
     // model.estimate();
 }

Solution

  • estimate() runs LDA, attempting to estimate the topic model given the data and settings you've already set up.

    Have a look at the main() function of the ParrallelTopicModel source for inspiration about what's needed to estimate a model.