Package cc.mallet.fst
Class MultiSegmentationEvaluator
- java.lang.Object
-
- cc.mallet.fst.TransducerEvaluator
-
- cc.mallet.fst.MultiSegmentationEvaluator
-
public class MultiSegmentationEvaluator extends TransducerEvaluator
Evaluates a transducer model, computes the precision, recall and F1 scores; considers segments that span across multiple tokens.
-
-
Field Summary
-
Fields inherited from class cc.mallet.fst.TransducerEvaluator
instanceListDescriptions, instanceLists
-
-
Constructor Summary
Constructors Constructor Description MultiSegmentationEvaluator(InstanceList[] instanceLists, java.lang.String[] instanceListDescriptions, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
MultiSegmentationEvaluator(InstanceList instanceList1, java.lang.String description1, InstanceList instanceList2, java.lang.String description2, InstanceList instanceList3, java.lang.String description3, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
MultiSegmentationEvaluator(InstanceList instanceList1, java.lang.String description1, InstanceList instanceList2, java.lang.String description2, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
MultiSegmentationEvaluator(InstanceList instanceList1, java.lang.String description1, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
batchTest(InstanceList data, java.util.List<Sequence> predictedSequences, java.lang.String description, java.io.PrintStream viterbiOutputStream)
Tests segmentation using an ArrayList of predicted Sequences instead of aTransducer
.void
evaluateInstanceList(TransducerTrainer tt, InstanceList data, java.lang.String description)
int
numIncorrectSegments(Sequence trueOutput, Sequence predOutput)
Returns the number of incorrect segments inpredOutput
-
Methods inherited from class cc.mallet.fst.TransducerEvaluator
evaluate, preamble, precondition
-
-
-
-
Constructor Detail
-
MultiSegmentationEvaluator
public MultiSegmentationEvaluator(InstanceList[] instanceLists, java.lang.String[] instanceListDescriptions, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
-
MultiSegmentationEvaluator
public MultiSegmentationEvaluator(InstanceList instanceList1, java.lang.String description1, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
-
MultiSegmentationEvaluator
public MultiSegmentationEvaluator(InstanceList instanceList1, java.lang.String description1, InstanceList instanceList2, java.lang.String description2, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
-
MultiSegmentationEvaluator
public MultiSegmentationEvaluator(InstanceList instanceList1, java.lang.String description1, InstanceList instanceList2, java.lang.String description2, InstanceList instanceList3, java.lang.String description3, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
-
-
Method Detail
-
evaluateInstanceList
public void evaluateInstanceList(TransducerTrainer tt, InstanceList data, java.lang.String description)
- Specified by:
evaluateInstanceList
in classTransducerEvaluator
-
numIncorrectSegments
public int numIncorrectSegments(Sequence trueOutput, Sequence predOutput)
Returns the number of incorrect segments inpredOutput
- Parameters:
trueOutput
- truthpredOutput
- predicted- Returns:
- number of incorrect segments
-
batchTest
public void batchTest(InstanceList data, java.util.List<Sequence> predictedSequences, java.lang.String description, java.io.PrintStream viterbiOutputStream)
Tests segmentation using an ArrayList of predicted Sequences instead of aTransducer
. If predictedSequence is null, don't include in stats (useful for error analysis).- Parameters:
data
- list of instances to be segmentedpredictedSequences
- predictionsdescription
- description of trialviterbiOutputStream
- where to print the Viterbi paths
-
-