|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.hmm.AbstractHmm
com.aliasi.hmm.AbstractHmmEstimator
public abstract class AbstractHmmEstimator
An HmmEstimator may be used to train a hidden Markov
model (HMM). Training events are supplied through the TagHandler interface method handle(String[],String[],String[]). The estimator implements an
HMM, so is suitable for use in a tag-a-little, learn-a-little
environment or elswhere when an adaptive HMM is required.
At any point, the estimator may be compiled to an object output
stream using compileTo(ObjectOutput).
| Constructor Summary | |
|---|---|
AbstractHmmEstimator(SymbolTable table)
Construct an HMM estimator with the specified tag symbol table. |
|
| Method Summary | |
|---|---|
abstract void |
compileTo(ObjectOutput objOut)
Compiles a copy of this estimated HMM to the specified object output. |
void |
handle(String[] toks,
String[] whitespaces,
String[] tags)
Train the estimator with the specified tokens, whitespaces and states. |
long |
numTrainingCases()
Return the number of taggings handled. |
long |
numTrainingTokens()
Returns the number of tokens handled for training. |
abstract void |
trainEmit(String state,
CharSequence emission)
Train the emission estimator with the specified training instance consisting of a state and emission. |
abstract void |
trainEnd(String state)
Train the end state estimator with the specified end state. |
abstract void |
trainStart(String state)
Train the start state estimator with the specified start state. |
abstract void |
trainTransit(String sourceState,
String targetState)
Trains the transition estimator from the specified transition from the specified source state to the specified target state. |
| Methods inherited from class com.aliasi.hmm.AbstractHmm |
|---|
addState, emitLog2Prob, emitLog2Prob, emitProb, emitProb, endLog2Prob, endLog2Prob, endProb, endProb, startLog2Prob, startLog2Prob, startProb, startProb, stateSymbolTable, transitLog2Prob, transitLog2Prob, transitProb, transitProb |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractHmmEstimator(SymbolTable table)
table - Symbol table for tags.| Method Detail |
|---|
public abstract void trainStart(String state)
state - State being trained.public abstract void trainEnd(String state)
state - State being trained.
public abstract void trainTransit(String sourceState,
String targetState)
sourceState - State from which the transition is made.targetState - State to which the transition is made.
public abstract void trainEmit(String state,
CharSequence emission)
state - State being trained.emission - Emission from state being trained.
public abstract void compileTo(ObjectOutput objOut)
throws IOException
HiddenMarkovModel, but will
most likely not be an instance of the same class as the object
being compiled.
compileTo in interface CompilableobjOut - Object output to which this estimator is
compiled.
IOException - If there is an I/O exception compiling this
object.public long numTrainingCases()
handle(String[],String[],String[])
has been called.
public long numTrainingTokens()
handle(String[],String[],String[]) method.
public void handle(String[] toks,
String[] whitespaces,
String[] tags)
For a specified set of tags and tokens, this method calls:
trainTransit(String,String)
on each tag pair,
trainEmit(String,CharSequence) on
each tag/token pair,
trainStart(String) on the first tag, and
trainEnd(String) on the last tag.
handle in interface TagHandlertoks - Tokens making up the emissions of the HMM states.whitespaces - Whitespaces between tokens; ignored.tags - Tags making up the states of the HMM.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||