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 theSegment
s produced by aTransducer
. It's most useful to find theSegment
s that theTransducer
is 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.ArrayList
correctLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags)
java.util.ArrayList
correctLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags, boolean findIncorrect)
Returns an ArrayList of corrected Sequences.java.util.ArrayList
getLeastConfidentSegments()
Returns the least confident segments from each sequence in the previous call tocorrectLeastConfidentSegments
java.util.ArrayList
getLeastConfidentSegments(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] continueTags)
Returns the least confident segments inilist
java.util.Vector
getSegmentConfidences()
-
-
-
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
Segment
s, 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:
correctLeastConfidentSegments
in 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
Sequence
s corresponding to the corrected tagging of each instance inilist
-
-