public class HMM extends Transducer implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
HMM.State |
protected static class |
HMM.TransitionIterator |
Transducer.BeamLattice, Transducer.Lattice, Transducer.ViterbiLattice, Transducer.ViterbiPath, Transducer.ViterbiPath_NBest, Transducer.ViterbiPathBeam, Transducer.ViterbiPathBeamB, Transducer.ViterbiPathBeamFB, Transducer.ViterbiPathBeamKLINFINITE_COST, inputPipe, outputPipe, ZERO_COST| Constructor and Description |
|---|
HMM(Alphabet inputAlphabet,
Alphabet outputAlphabet) |
HMM(Pipe inputPipe,
Pipe outputPipe) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFullyConnectedStates(String[] stateNames) |
void |
addFullyConnectedStatesForBiLabels() |
void |
addFullyConnectedStatesForLabels() |
void |
addFullyConnectedStatesForThreeQuarterLabels(InstanceList trainingSet) |
void |
addFullyConnectedStatesForTriLabels() |
String |
addOrderNStates(InstanceList trainingSet,
int[] orders,
boolean[] defaults,
String start,
Pattern forbidden,
Pattern allowed,
boolean fullyConnected)
Assumes that the HMM's output alphabet contains
Strings. |
void |
addSelfTransitioningStateForAllLabels(String name) |
void |
addState(String name,
double initialCost,
double finalCost,
String[] destinationNames,
String[] labelNames) |
void |
addState(String name,
String[] destinationNames) |
void |
addStatesForBiLabelsConnectedAsIn(InstanceList trainingSet)
Add states to create a second-order Markov model on labels,
adding only those transitions the occur in the given
trainingSet.
|
void |
addStatesForHalfLabelsConnectedAsIn(InstanceList trainingSet)
Add as many states as there are labels, but don't create separate weights
for each source-destination pair of states.
|
void |
addStatesForLabelsConnectedAsIn(InstanceList trainingSet)
Add states to create a first-order Markov model on labels,
adding only those transitions the occur in the given
trainingSet.
|
void |
addStatesForThreeQuarterLabelsConnectedAsIn(InstanceList trainingSet)
Add as many states as there are labels, but don't create
separate observational-test-weights for each source-destination
pair of states---instead have all the incoming transitions to a
state share the same observational-feature-test weights.
|
void |
estimate() |
Alphabet |
getInputAlphabet() |
Alphabet |
getOutputAlphabet() |
Transducer.State |
getState(int index) |
HMM.State |
getState(String name) |
Iterator |
initialStateIterator() |
boolean |
isTrainable() |
int |
numStates() |
void |
print() |
void |
reset() |
boolean |
train(InstanceList ilist) |
boolean |
train(InstanceList ilist,
InstanceList validation,
InstanceList testing) |
boolean |
train(InstanceList ilist,
InstanceList validation,
InstanceList testing,
TransducerEvaluator eval) |
void |
write(File f) |
averageTokenAccuracy, averageTokenAccuracy, canIterateAllTransitions, forwardBackward, forwardBackward, forwardBackward, forwardBackward, forwardBackward, forwardBackward, forwardBackward, forwardBackward, forwardBackwardBeam, forwardBackwardBeam, forwardBackwardBeam, forwardBackwardBeam, forwardBackwardBeam, forwardBackwardBeam, forwardBackwardBeam, forwardBackwardBeam, generatePath, getBeamWidth, getInputPipe, getNstatesExpl, getOutputPipe, getViterbiLattice, incIter, isGenerative, pipe, setBeamWidth, setCurIter, setKLeps, setRmin, setTrainable, setUseForwardBackwardBeam, stateIndexOfString, sumNegLogProb, transduce, viterbiPath_NBest, viterbiPath_NBest, viterbiPath, viterbiPath, viterbiPath, viterbiPathBeam, viterbiPathBeam, viterbiPathBeam, viterbiPathBeamB, viterbiPathBeamB, viterbiPathBeamB, viterbiPathBeamB, viterbiPathBeamFB, viterbiPathBeamFB, viterbiPathBeamFB, viterbiPathBeamFB, viterbiPathBeamKL, viterbiPathBeamKL, viterbiPathBeamKLpublic Alphabet getInputAlphabet()
public Alphabet getOutputAlphabet()
public void print()
print in class Transducerpublic void addState(String name, double initialCost, double finalCost, String[] destinationNames, String[] labelNames)
public void addFullyConnectedStates(String[] stateNames)
public void addFullyConnectedStatesForLabels()
public void addStatesForLabelsConnectedAsIn(InstanceList trainingSet)
public void addStatesForHalfLabelsConnectedAsIn(InstanceList trainingSet)
public void addStatesForThreeQuarterLabelsConnectedAsIn(InstanceList trainingSet)
public void addFullyConnectedStatesForThreeQuarterLabels(InstanceList trainingSet)
public void addFullyConnectedStatesForBiLabels()
public void addStatesForBiLabelsConnectedAsIn(InstanceList trainingSet)
public void addFullyConnectedStatesForTriLabels()
public void addSelfTransitioningStateForAllLabels(String name)
public String addOrderNStates(InstanceList trainingSet, int[] orders, boolean[] defaults, String start, Pattern forbidden, Pattern allowed, boolean fullyConnected)
Strings. Creates an order-n HMM with input
predicates and output labels given by trainingSet
and order, connectivity, and weights given by the remaining
arguments.trainingSet - the training instancesorders - an array of increasing non-negative numbers giving
the orders of the features for this HMM. The largest number
n is the Markov order of the HMM. States are
n-tuples of output labels. Each of the other numbers
k in orders represents a weight set shared
by all destination states whose last (most recent) k
labels agree. If orders is null, an
order-0 HMM is built.defaults - If non-null, it must be the same length as
orders, with true positions indicating
that the weight set for the corresponding order contains only the
weight for a default feature; otherwise, the weight set has
weights for all features built from input predicates.start - The label that represents the context of the start of
a sequence. It may be also used for sequence labels.forbidden - If non-null, specifies what pairs of successive
labels are not allowed, both for constructing norder
states or for transitions. A label pair (u,v)
is not allowed if u + "," + v matches
forbidden.allowed - If non-null, specifies what pairs of successive
labels are allowed, both for constructing norder
states or for transitions. A label pair (u,v)
is allowed only if u + "," + v matches
allowed.fullyConnected - Whether to include all allowed transitions,
even those not occurring in trainingSet,public int numStates()
numStates in class Transducerpublic Transducer.State getState(int index)
getState in class Transducerpublic Iterator initialStateIterator()
initialStateIterator in class Transducerpublic boolean isTrainable()
isTrainable in class Transducerpublic void reset()
public void estimate()
public boolean train(InstanceList ilist)
train in class Transducerpublic boolean train(InstanceList ilist, InstanceList validation, InstanceList testing)
public boolean train(InstanceList ilist, InstanceList validation, InstanceList testing, TransducerEvaluator eval)
public void write(File f)
Copyright © 2019 JULIE Lab, Germany. All rights reserved.