cc.mallet.grmm.learning.extract
Class ACRFExtractorTrainer

java.lang.Object
  extended by cc.mallet.grmm.learning.extract.ACRFExtractorTrainer

public class ACRFExtractorTrainer
extends java.lang.Object

Created: Mar 31, 2005

Version:
$Id: ACRFExtractorTrainer.java,v 1.1 2007/10/22 21:38:02 mccallum Exp $
Author:
Field Summary
protected  ACRFEvaluator evaluator
           
protected  Pipe featurePipe
           
protected  InstanceList testing
           
protected  ACRF.Template[] tmpls
           
protected  Pipe tokPipe
           
protected  InstanceList training
           
 
Constructor Summary
ACRFExtractorTrainer()
           
 
Method Summary
 Extraction extractOnTestData(ACRFExtractor extor)
           
 TokenizationFilter getFilter()
           
 int getNumIter()
           
 InstanceList getTestingData()
           
 ACRFTrainer getTrainer()
           
 InstanceList getTrainingData()
           
 ACRFExtractorTrainer setCacheUnrolledGraphs(boolean cacheUnrolledGraphs)
           
 ACRFExtractorTrainer setCheckpointDirectory(java.io.File checkpointDirectory)
           
 ACRFExtractorTrainer setData(InstanceList training, InstanceList testing)
           
 ACRFExtractorTrainer setDataSource(java.util.Iterator<Instance> trainIterator, java.util.Iterator<Instance> testIterator)
           
 ACRFExtractorTrainer setDataSubsets(java.util.Random random, double trainingPct, double testingPct)
           
 ACRFExtractorTrainer setEvaluator(ACRFEvaluator evaluator)
           
 ACRFExtractorTrainer setInferencer(Inferencer inferencer)
           
 ACRFExtractorTrainer setNumCheckpointIterations(int numCheckpointIterations)
           
 ACRFExtractorTrainer setNumIterations(int numIter)
           
 ACRFExtractorTrainer setPerTemplateIterations(int numIter)
           
 ACRFExtractorTrainer setPipes(Pipe tokPipe, Pipe featurePipe)
           
 ACRFExtractorTrainer setTemplates(ACRF.Template[] tmpls)
           
 ACRFExtractorTrainer setTokenizatioFilter(TokenizationFilter filter)
           
 ACRFExtractorTrainer setTrainingMethod(ACRFTrainer acrfTrainer)
           
protected  void setupData()
           
 ACRFExtractorTrainer setUsePerTemplateTrain(boolean usePerTemplateTrain)
           
 ACRFExtractorTrainer setViterbiInferencer(Inferencer viterbiInferencer)
           
 ACRF trainAcrf()
          Trains a new ACRF object with the given settings.
 ACRFExtractor trainExtractor()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tmpls

protected ACRF.Template[] tmpls

training

protected InstanceList training

testing

protected InstanceList testing

featurePipe

protected Pipe featurePipe

tokPipe

protected Pipe tokPipe

evaluator

protected ACRFEvaluator evaluator
Constructor Detail

ACRFExtractorTrainer

public ACRFExtractorTrainer()
Method Detail

setTemplates

public ACRFExtractorTrainer setTemplates(ACRF.Template[] tmpls)

setDataSource

public ACRFExtractorTrainer setDataSource(java.util.Iterator<Instance> trainIterator,
                                          java.util.Iterator<Instance> testIterator)

setData

public ACRFExtractorTrainer setData(InstanceList training,
                                    InstanceList testing)

setNumIterations

public ACRFExtractorTrainer setNumIterations(int numIter)

getNumIter

public int getNumIter()

setPipes

public ACRFExtractorTrainer setPipes(Pipe tokPipe,
                                     Pipe featurePipe)

setEvaluator

public ACRFExtractorTrainer setEvaluator(ACRFEvaluator evaluator)

setTrainingMethod

public ACRFExtractorTrainer setTrainingMethod(ACRFTrainer acrfTrainer)

setTokenizatioFilter

public ACRFExtractorTrainer setTokenizatioFilter(TokenizationFilter filter)

setCacheUnrolledGraphs

public ACRFExtractorTrainer setCacheUnrolledGraphs(boolean cacheUnrolledGraphs)

setNumCheckpointIterations

public ACRFExtractorTrainer setNumCheckpointIterations(int numCheckpointIterations)

setCheckpointDirectory

public ACRFExtractorTrainer setCheckpointDirectory(java.io.File checkpointDirectory)

setUsePerTemplateTrain

public ACRFExtractorTrainer setUsePerTemplateTrain(boolean usePerTemplateTrain)

setPerTemplateIterations

public ACRFExtractorTrainer setPerTemplateIterations(int numIter)

getTrainer

public ACRFTrainer getTrainer()

getFilter

public TokenizationFilter getFilter()

trainExtractor

public ACRFExtractor trainExtractor()

trainAcrf

public ACRF trainAcrf()
Trains a new ACRF object with the given settings. Subclasses may override this method to implement alternative training procedures.

Returns:
a trained ACRF

setupData

protected void setupData()

getTrainingData

public InstanceList getTrainingData()

getTestingData

public InstanceList getTestingData()

extractOnTestData

public Extraction extractOnTestData(ACRFExtractor extor)

setInferencer

public ACRFExtractorTrainer setInferencer(Inferencer inferencer)

setViterbiInferencer

public ACRFExtractorTrainer setViterbiInferencer(Inferencer viterbiInferencer)

setDataSubsets

public ACRFExtractorTrainer setDataSubsets(java.util.Random random,
                                           double trainingPct,
                                           double testingPct)