cc.mallet.fst
Class MaxLatticeDefault
- java.lang.Object
-
- cc.mallet.fst.MaxLatticeDefault
-
- All Implemented Interfaces:
- MaxLattice
public class MaxLatticeDefault extends java.lang.Object implements MaxLattice
Default, full dynamic programming version of the Viterbi "Max-(Product)-Lattice" algorithm.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classMaxLatticeDefault.Factory
-
Constructor Summary
Constructors Constructor and Description MaxLatticeDefault(Transducer t, Sequence inputSequence)MaxLatticeDefault(Transducer t, Sequence inputSequence, Sequence outputSequence)MaxLatticeDefault(Transducer t, Sequence inputSequence, Sequence outputSequence, int maxCaches)Initiate Viterbi decoding of the inputSequence, contrained to match non-null parts of the outputSequence.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SequencePairAlignment<java.lang.Object,java.lang.Object>bestOutputAlignment()java.util.List<SequencePairAlignment<java.lang.Object,java.lang.Object>>bestOutputAlignments(int n)Sequence<java.lang.Object>bestOutputSequence()java.util.List<Sequence<java.lang.Object>>bestOutputSequences(int n)SequencePairAlignment<java.lang.Object,Transducer.State>bestStateAlignment()java.util.List<SequencePairAlignment<java.lang.Object,Transducer.State>>bestStateAlignments(int n)Perform the backward pass of Viterbi, returning the n-best sequences of States.Sequence<Transducer.State>bestStateSequence()java.util.List<Sequence<Transducer.State>>bestStateSequences(int n)java.util.List<SequencePairAlignment<java.lang.Object,cc.mallet.fst.MaxLatticeDefault.ViterbiNode>>bestViterbiNodeSequences(int n)Perform the backward pass of Viterbi, returning the n-best sequences of ViterbiNodes.doublebestWeight()doubleelementwiseAccuracy(Sequence referenceOutput)doublegetDelta(int ip, int stateIndex)SequencegetInput()SequencegetProvidedOutput()TransducergetTransducer()voidincrementTransducer(Transducer.Incrementor incrementor)Increment states and transitions with a count of 1.0 along the best state sequence.doubletokenAccuracy(Sequence referenceOutput, java.io.PrintWriter out)
-
-
-
Constructor Detail
-
MaxLatticeDefault
public MaxLatticeDefault(Transducer t, Sequence inputSequence)
-
MaxLatticeDefault
public MaxLatticeDefault(Transducer t, Sequence inputSequence, Sequence outputSequence)
-
MaxLatticeDefault
public MaxLatticeDefault(Transducer t, Sequence inputSequence, Sequence outputSequence, int maxCaches)
Initiate Viterbi decoding of the inputSequence, contrained to match non-null parts of the outputSequence. maxCaches indicates how much state information to memoize in n-best decoding.
-
-
Method Detail
-
getTransducer
public Transducer getTransducer()
- Specified by:
getTransducerin interfaceMaxLattice
-
getInput
public Sequence getInput()
-
getProvidedOutput
public Sequence getProvidedOutput()
-
getDelta
public double getDelta(int ip, int stateIndex)- Specified by:
getDeltain interfaceMaxLattice
-
bestViterbiNodeSequences
public java.util.List<SequencePairAlignment<java.lang.Object,cc.mallet.fst.MaxLatticeDefault.ViterbiNode>> bestViterbiNodeSequences(int n)
Perform the backward pass of Viterbi, returning the n-best sequences of ViterbiNodes. Each ViterbiNode contains the state, output symbol, and other information. Note that the length of each ViterbiNode Sequence is inputLength+1, because the first element of the sequence is the start state, and the first input/output symbols occur on the transition from a start-state to the next state. These first input/output symbols are stored in the second ViterbiNode in the sequence. The last ViterbiNode in the sequence corresponds to the final state and has the last input/output symbols.
-
bestStateAlignments
public java.util.List<SequencePairAlignment<java.lang.Object,Transducer.State>> bestStateAlignments(int n)
Perform the backward pass of Viterbi, returning the n-best sequences of States. Note that the length of each State Sequence is inputLength+1, because the first element of the sequence is the start state, and the first input/output symbols occur on the transition from a start state to the next state. The last State in the sequence corresponds to the final state.
-
bestStateAlignment
public SequencePairAlignment<java.lang.Object,Transducer.State> bestStateAlignment()
-
bestStateSequences
public java.util.List<Sequence<Transducer.State>> bestStateSequences(int n)
- Specified by:
bestStateSequencesin interfaceMaxLattice
-
bestStateSequence
public Sequence<Transducer.State> bestStateSequence()
- Specified by:
bestStateSequencein interfaceMaxLattice
-
bestOutputAlignments
public java.util.List<SequencePairAlignment<java.lang.Object,java.lang.Object>> bestOutputAlignments(int n)
-
bestOutputAlignment
public SequencePairAlignment<java.lang.Object,java.lang.Object> bestOutputAlignment()
-
bestOutputSequences
public java.util.List<Sequence<java.lang.Object>> bestOutputSequences(int n)
- Specified by:
bestOutputSequencesin interfaceMaxLattice
-
bestOutputSequence
public Sequence<java.lang.Object> bestOutputSequence()
- Specified by:
bestOutputSequencein interfaceMaxLattice
-
bestWeight
public double bestWeight()
-
incrementTransducer
public void incrementTransducer(Transducer.Incrementor incrementor)
Increment states and transitions with a count of 1.0 along the best state sequence. This provides for a so-called "Viterbi training" approximation.
-
elementwiseAccuracy
public double elementwiseAccuracy(Sequence referenceOutput)
- Specified by:
elementwiseAccuracyin interfaceMaxLattice
-
tokenAccuracy
public double tokenAccuracy(Sequence referenceOutput, java.io.PrintWriter out)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG