|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJet.HMM.HMMstate
a state of a Hidden Markov Model.
Field Summary | |
java.lang.String |
name
the name of the state. |
static double |
otherPreference
a preference (log probability) to be given to states with tag 'other'. |
java.lang.String |
tag
the tag of the state. |
Constructor Summary | |
HMMstate(java.lang.String name,
java.lang.String tag,
java.lang.Class emitterClass)
|
Method Summary | |
void |
addAllowedFeatureValue(java.lang.String s)
allow tokens for which feature tokenType == s to be emitted by this state. |
void |
addArc(HMMarc arc)
add arc arc to the set of arcs leaving this state. |
void |
addArc(java.lang.String arcName)
add an arc to the state named arcName to the set of
arcs leaving this state. |
boolean |
allowedToken(Annotation token)
returns true if token token can be emitted by this state. |
void |
computeProbabilities()
compute the probabilities for token emission and arc transition from the counts acquired during training. |
double |
getEmissionProb(java.lang.String tokenText,
java.lang.String priorToken,
Annotation token)
returns the probability of emitting 'token' with attributes 'fs' when in this state. |
double |
getTransitionProb(int state)
returns the probability of a transition from this state to the state numbered 'state' in the HMM. |
void |
incrementEmitCount(java.lang.String token,
java.lang.String priorToken,
int n)
(during training), add 1 to the count of the times that 'token' is emitted by this state. |
void |
print()
prints a state, along with its tag, its feature constraint (if any) its arcs, and its emission probabilities. |
void |
resetForTraining()
initialize the state for training. |
void |
resolveNames(java.util.HashMap statesByName,
int nStates)
|
void |
setCacheCount(java.lang.String tag,
int n)
|
void |
setFeatureName(java.lang.String s)
imposes a feature constraint on tokens which match this state. |
void |
setHMM(HMM hmm)
|
void |
store(java.io.PrintWriter stream)
writes a state, along with its tag, its feature constraint (if any), its arcs, and its emission probabilities, to 'stream', in a form that can be reloaded by HMM.load(java.io.Reader) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.String name
public java.lang.String tag
public static double otherPreference
Constructor Detail |
public HMMstate(java.lang.String name, java.lang.String tag, java.lang.Class emitterClass)
Method Detail |
public void addArc(HMMarc arc)
arc
to the set of arcs leaving this state.
public void addArc(java.lang.String arcName)
arcName
to the set of
arcs leaving this state.
public void resolveNames(java.util.HashMap statesByName, int nStates)
public void setHMM(HMM hmm)
public void resetForTraining()
public void incrementEmitCount(java.lang.String token, java.lang.String priorToken, int n)
public void setCacheCount(java.lang.String tag, int n)
public void setFeatureName(java.lang.String s)
public void addAllowedFeatureValue(java.lang.String s)
public boolean allowedToken(Annotation token)
token
can be emitted by this state.
This will be true if either no feature name has been specified,
, or if a feature name has been specified (through a call on
setFeatureName
), and that feature has one of the allowed
feature values (as specified by addAllowedFeatureValue
.
public void computeProbabilities()
public void print()
public void store(java.io.PrintWriter stream)
HMM.load(java.io.Reader)
.
public double getEmissionProb(java.lang.String tokenText, java.lang.String priorToken, Annotation token)
public double getTransitionProb(int state)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |