Package cc.mallet.fst
Class TransducerEvaluator
- java.lang.Object
-
- cc.mallet.fst.TransducerEvaluator
-
- Direct Known Subclasses:
CRFWriter
,InstanceAccuracyEvaluator
,LabelDistributionEvaluator
,MultiSegmentationEvaluator
,PerClassAccuracyEvaluator
,SegmentationEvaluator
,TokenAccuracyEvaluator
,ViterbiWriter
public abstract class TransducerEvaluator extends java.lang.Object
An abstract class to evaluate a transducer model.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
instanceListDescriptions
protected InstanceList[]
instanceLists
-
Constructor Summary
Constructors Constructor Description TransducerEvaluator()
TransducerEvaluator(InstanceList[] instanceLists, java.lang.String[] instanceListDescriptions)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
evaluate(TransducerTrainer tt)
Evaluates a TransducerTrainer and its Transducer on the instance lists specified in the constructor.abstract void
evaluateInstanceList(TransducerTrainer transducer, InstanceList instances, java.lang.String description)
protected void
preamble(TransducerTrainer tt)
boolean
precondition(TransducerTrainer tt)
If this returns false, then the body of the evaluate(TransducerTrainer) method will not run.
-
-
-
Field Detail
-
instanceLists
protected InstanceList[] instanceLists
-
instanceListDescriptions
protected java.lang.String[] instanceListDescriptions
-
-
Constructor Detail
-
TransducerEvaluator
public TransducerEvaluator()
-
TransducerEvaluator
public TransducerEvaluator(InstanceList[] instanceLists, java.lang.String[] instanceListDescriptions)
-
-
Method Detail
-
evaluate
public void evaluate(TransducerTrainer tt)
Evaluates a TransducerTrainer and its Transducer on the instance lists specified in the constructor. .The default implementation calls the evaluator's evaluateInstanceList on each instance list.
- Parameters:
tt
- The TransducerTrainer to evaluate.
-
preamble
protected void preamble(TransducerTrainer tt)
-
precondition
public boolean precondition(TransducerTrainer tt)
If this returns false, then the body of the evaluate(TransducerTrainer) method will not run. Use this method to implement behaviors such as only evaluating every 5 iterations withnew TokenAccuracyEvaluator (crft) { public boolean precondition (TransducerTrainer tt) { return tt.getIteration() % 5 == 0; };
-
evaluateInstanceList
public abstract void evaluateInstanceList(TransducerTrainer transducer, InstanceList instances, java.lang.String description)
-
-