cc.mallet.fst
Class MultiSegmentationEvaluator

java.lang.Object
  extended by cc.mallet.fst.TransducerEvaluator
      extended by 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
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
 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 a Transducer.
 void evaluateInstanceList(TransducerTrainer tt, InstanceList data, java.lang.String description)
           
 int numIncorrectSegments(Sequence trueOutput, Sequence predOutput)
          Returns the number of incorrect segments in predOutput
 
Methods inherited from class cc.mallet.fst.TransducerEvaluator
evaluate, preamble, precondition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 class TransducerEvaluator

numIncorrectSegments

public int numIncorrectSegments(Sequence trueOutput,
                                Sequence predOutput)
Returns the number of incorrect segments in predOutput

Parameters:
trueOutput - truth
predOutput - 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 a Transducer. If predictedSequence is null, don't include in stats (useful for error analysis).

Parameters:
data - list of instances to be segmented
predictedSequences - predictions
description - description of trial
viterbiOutputStream - where to print the Viterbi paths