public class HMMstate extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
name
the name of the state.
|
static double |
otherPreference
a preference (log probability) to be given to states with tag 'other'.
|
String |
tag
the tag of the state.
|
| Constructor and Description |
|---|
HMMstate(String name,
String tag,
Class emitterClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllowedFeatureValue(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(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(String tokenText,
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(String token,
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(HashMap statesByName,
int nStates) |
void |
setCacheCount(String tag,
int n) |
void |
setFeatureName(String s)
imposes a feature constraint on tokens which match this state.
|
void |
setHMM(HMM hmm) |
void |
store(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). |
public String name
public String tag
public static double otherPreference
public void addArc(HMMarc arc)
arc to the set of arcs leaving this state.public void addArc(String arcName)
arcName to the set of
arcs leaving this state.public void resolveNames(HashMap statesByName, int nStates)
public void setHMM(HMM hmm)
public void resetForTraining()
public void incrementEmitCount(String token, String priorToken, int n)
public void setCacheCount(String tag, int n)
public void setFeatureName(String s)
public void addAllowedFeatureValue(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(java.lang.String)), and that feature has one of the allowed
feature values (as specified by addAllowedFeatureValue(java.lang.String).public void computeProbabilities()
public void print()
public void store(PrintWriter stream)
HMM.load(java.io.Reader).public double getEmissionProb(String tokenText, String priorToken, Annotation token)
public double getTransitionProb(int state)
Copyright © 2016 New York University. All rights reserved.