Package cc.mallet.fst.confidence
Class ConstrainedViterbiTransducerCorrector
- java.lang.Object
-
- cc.mallet.fst.confidence.ConstrainedViterbiTransducerCorrector
-
- All Implemented Interfaces:
TransducerCorrector
public class ConstrainedViterbiTransducerCorrector extends java.lang.Object implements TransducerCorrector
Corrects a subset of theSegments produced by aTransducer. It's most useful to find theSegments that theTransduceris least confident in and correct those using the trueLabeling(correctLeastConfidenceSegments). The corrected segment then propagates to other labelings in the sequence using "constrained viterbi" -- a viterbi calculation that requires the path to pass through the corrected segment states.
-
-
Constructor Summary
Constructors Constructor Description ConstrainedViterbiTransducerCorrector(TransducerConfidenceEstimator confidenceEstimator, Transducer model)ConstrainedViterbiTransducerCorrector(Transducer model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayListcorrectLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags)java.util.ArrayListcorrectLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags, boolean findIncorrect)Returns an ArrayList of corrected Sequences.java.util.ArrayListgetLeastConfidentSegments()Returns the least confident segments from each sequence in the previous call tocorrectLeastConfidentSegmentsjava.util.ArrayListgetLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags)Returns the least confident segments inilistjava.util.VectorgetSegmentConfidences()
-
-
-
Constructor Detail
-
ConstrainedViterbiTransducerCorrector
public ConstrainedViterbiTransducerCorrector(TransducerConfidenceEstimator confidenceEstimator, Transducer model)
-
ConstrainedViterbiTransducerCorrector
public ConstrainedViterbiTransducerCorrector(Transducer model)
-
-
Method Detail
-
getSegmentConfidences
public java.util.Vector getSegmentConfidences()
-
getLeastConfidentSegments
public java.util.ArrayList getLeastConfidentSegments()
Returns the least confident segments from each sequence in the previous call tocorrectLeastConfidentSegments
-
getLeastConfidentSegments
public java.util.ArrayList getLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags)
Returns the least confident segments inilist- Parameters:
ilist- test instancesstartTags- indicate the beginning of segmentscontinueTages- indicate "inside" of segments- Returns:
- list of
Segments, one for each instance, that is least confident
-
correctLeastConfidentSegments
public java.util.ArrayList correctLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags)
- Specified by:
correctLeastConfidentSegmentsin interfaceTransducerCorrector
-
correctLeastConfidentSegments
public java.util.ArrayList correctLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags, boolean findIncorrect)
Returns an ArrayList of corrected Sequences. Also stores leastConfidentSegments, an ArrayList of the segments to correct, where null entries mean no segment was corrected for that sequence.- Parameters:
ilist- test instancesstartTags- indicate the beginning of segmentscontinueTages- indicate "inside" of segmentsfindIncorrect- true if we should cycle through least confident segments until find an incorrect one- Returns:
- list of
Sequences corresponding to the corrected tagging of each instance inilist
-
-