cc.mallet.fst.semi_supervised
Class CRFTrainerByGE

java.lang.Object
  extended by cc.mallet.fst.TransducerTrainer
      extended by cc.mallet.fst.semi_supervised.CRFTrainerByGE

public class CRFTrainerByGE
extends TransducerTrainer

Trains a CRF using Generalized Expectation constraints that consider either a single label or a pair of labels of a linear chain CRF. See: "Generalized Expectation Criteria for Semi-Supervised Learning of Conditional Random Fields" Gideon Mann and Andrew McCallum ACL 2008

Author:
Gregory Druck

Nested Class Summary
 
Nested classes/interfaces inherited from class cc.mallet.fst.TransducerTrainer
TransducerTrainer.ByIncrements, TransducerTrainer.ByInstanceIncrements, TransducerTrainer.ByOptimization
 
Constructor Summary
CRFTrainerByGE(CRF crf, java.util.ArrayList<GEConstraint> constraints)
           
CRFTrainerByGE(CRF crf, java.util.ArrayList<GEConstraint> constraints, int numThreads)
           
 
Method Summary
 int getIteration()
           
 Optimizable.ByGradientValue getOptimizable(InstanceList unlabeled)
           
 Optimizer getOptimizer(Optimizable.ByGradientValue optimizable)
           
 Transducer getTransducer()
           
 boolean isFinishedTraining()
           
 void setGaussianPriorVariance(double gpv)
           
 void setNumResets(int numResets)
          Sets number of resets of L-BFGS during optimization.
 void setOptimizable(Optimizer optimizer)
           
 void setStateLabelMap(StateLabelMap map)
           
 boolean train(InstanceList unlabeledSet, int numIterations)
          Train the transducer associated with this TransducerTrainer.
 
Methods inherited from class cc.mallet.fst.TransducerTrainer
addEvaluator, addEvaluators, removeEvaluator, runEvaluators, train
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRFTrainerByGE

public CRFTrainerByGE(CRF crf,
                      java.util.ArrayList<GEConstraint> constraints)

CRFTrainerByGE

public CRFTrainerByGE(CRF crf,
                      java.util.ArrayList<GEConstraint> constraints,
                      int numThreads)
Method Detail

getIteration

public int getIteration()
Specified by:
getIteration in class TransducerTrainer

getTransducer

public Transducer getTransducer()
Specified by:
getTransducer in class TransducerTrainer

isFinishedTraining

public boolean isFinishedTraining()
Specified by:
isFinishedTraining in class TransducerTrainer

setGaussianPriorVariance

public void setGaussianPriorVariance(double gpv)

setNumResets

public void setNumResets(int numResets)
Sets number of resets of L-BFGS during optimization. Resetting more times can be useful since the GE objective function is non-convex

Parameters:
numResets - Number of resets of L-BFGS

setStateLabelMap

public void setStateLabelMap(StateLabelMap map)

setOptimizable

public void setOptimizable(Optimizer optimizer)

getOptimizable

public Optimizable.ByGradientValue getOptimizable(InstanceList unlabeled)

getOptimizer

public Optimizer getOptimizer(Optimizable.ByGradientValue optimizable)

train

public boolean train(InstanceList unlabeledSet,
                     int numIterations)
Description copied from class: TransducerTrainer
Train the transducer associated with this TransducerTrainer. You should be able to call this method with different trainingSet objects. Whether this causes the TransducerTrainer to combine both trainingSets or to view the second as a new alternative is at the discretion of the particular TransducerTrainer subclass involved.

Specified by:
train in class TransducerTrainer