|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.fst.Transducer
public abstract class Transducer
A base class for all sequence models, analogous to classify.Classifier
.
Nested Class Summary | |
---|---|
static interface |
Transducer.Incrementor
Methods to be called by inference methods to indicate partial counts of sufficient statistics. |
static class |
Transducer.State
An abstract class used to represent the states of the transducer. |
static class |
Transducer.TransitionIterator
An abstract class to iterate over the states of the transducer. |
Field Summary | |
---|---|
static double |
CERTAIN_WEIGHT
|
static double |
IMPOSSIBLE_WEIGHT
|
protected Pipe |
inputPipe
A pipe that should produce a Sequence in the "data" slot, (and possibly one in the "target" slot also |
protected Pipe |
outputPipe
A pipe that should expect the Transducer's output sequence in the "target" slot, and should produce something printable in the "source" slot that indicates the results of transduction. |
Constructor Summary | |
---|---|
Transducer()
Initializes default sum-product and max-product inference engines. |
|
Transducer(Pipe inputPipe,
Pipe outputPipe)
|
Method Summary | |
---|---|
double |
averageTokenAccuracy(InstanceList ilist)
Runs inference across all the instances and returns the average token accuracy. |
boolean |
canIterateAllTransitions()
Some transducers are "generative", meaning that you can get a sequence out of them without giving them an input sequence. |
SequencePairAlignment |
generatePath()
|
Pipe |
getInputPipe()
|
MaxLatticeFactory |
getMaxLatticeFactory()
|
Pipe |
getOutputPipe()
|
abstract Transducer.State |
getState(int index)
|
SumLatticeFactory |
getSumLatticeFactory()
|
abstract java.util.Iterator |
initialStateIterator()
|
boolean |
isGenerative()
If true, this is a "generative transducer". |
Instance |
label(Instance instance)
Take input sequence from instance.data and put the output sequence in instance.target. |
static double |
less_efficient_sumLogProb(double a,
double b)
|
static double |
no_longer_needed_sumNegLogProb(double a,
double b)
|
abstract int |
numStates()
|
void |
print()
|
void |
setMaxLatticeFactory(MaxLatticeFactory vf)
|
void |
setSumLatticeFactory(SumLatticeFactory fbf)
|
int |
stateIndexOfString(java.lang.String s)
Returns the index of the input state name, returns -1 if name not found. |
static double |
sumLogProb(double a,
double b)
Returns Math.log(Math.exp(a) + Math.exp(b)). |
Instance |
transduce(Instance instance)
Take input sequence from instance.data and put the output sequence in instance.data. |
Sequence |
transduce(Sequence input)
Converts the given sequence into another sequence according to this transducer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double CERTAIN_WEIGHT
public static final double IMPOSSIBLE_WEIGHT
protected Pipe inputPipe
protected Pipe outputPipe
Constructor Detail |
---|
public Transducer()
public Transducer(Pipe inputPipe, Pipe outputPipe)
Method Detail |
---|
public Pipe getInputPipe()
public Pipe getOutputPipe()
public void setSumLatticeFactory(SumLatticeFactory fbf)
public void setMaxLatticeFactory(MaxLatticeFactory vf)
public SumLatticeFactory getSumLatticeFactory()
public MaxLatticeFactory getMaxLatticeFactory()
public Instance label(Instance instance)
public Instance transduce(Instance instance)
public Sequence transduce(Sequence input)
input
- Input sequence
public abstract int numStates()
public abstract Transducer.State getState(int index)
public abstract java.util.Iterator initialStateIterator()
public boolean canIterateAllTransitions()
public boolean isGenerative()
public double averageTokenAccuracy(InstanceList ilist)
public SequencePairAlignment generatePath()
public int stateIndexOfString(java.lang.String s)
public void print()
public static double no_longer_needed_sumNegLogProb(double a, double b)
public static double sumLogProb(double a, double b)
a, b represent weights.
public static double less_efficient_sumLogProb(double a, double b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |