public class MorphWeightVector extends java.lang.Object implements WeightVector, FloatWeights
| Constructor and Description |
|---|
MorphWeightVector(MorphOptions options) |
| Modifier and Type | Method and Description |
|---|---|
protected double |
applyPenalty(int index,
double weight,
double[] accumulated_penalty) |
double |
dotProduct(State state,
FeatureVector vector) |
FeatureVector |
extractStateFeatures(Sequence sequence,
int token_index) |
FeatureVector |
extractStateFeatures(State state) |
FeatureVector |
extractTransitionFeatures(State state) |
FeatureTable |
getFeatureTable() |
int |
getFloatIndex(int feature,
int tag_index) |
double |
getFloatWeight(int index) |
double[] |
getFloatWeights() |
MorphModel |
getModel() |
MorphDictionary |
getMorphDict() |
protected int |
getObservedIndex(MorphFeatureVector vector,
State state) |
protected int |
getSimpleSubMorphIndex(int sub_morph_index) |
protected double |
getWeight(int index) |
double[] |
getWeights() |
void |
init(Model model,
java.util.Collection<Sequence> sequences) |
protected void |
prepareEncoder() |
void |
scaleBy(double scale_factor) |
void |
setExtendFeatureSet(boolean flag) |
void |
setFloatWeights(double[] weights) |
void |
setPenalty(boolean penalize,
double accumulated_penalty) |
void |
setWeights(double[] weights) |
void |
updateFloatWeight(int index,
double value) |
protected void |
updateWeight(int index,
double value) |
void |
updateWeights(State state,
double value,
boolean is_transition) |
public MorphWeightVector(MorphOptions options)
public void setExtendFeatureSet(boolean flag)
setExtendFeatureSet in interface WeightVectorpublic void setPenalty(boolean penalize,
double accumulated_penalty)
setPenalty in interface WeightVectorpublic FeatureVector extractStateFeatures(State state)
extractStateFeatures in interface WeightVectorpublic FeatureVector extractStateFeatures(Sequence sequence, int token_index)
extractStateFeatures in interface WeightVectorpublic FeatureVector extractTransitionFeatures(State state)
extractTransitionFeatures in interface WeightVectorprotected double getWeight(int index)
public double dotProduct(State state, FeatureVector vector)
dotProduct in interface WeightVectorpublic double getFloatWeight(int index)
getFloatWeight in interface FloatWeightspublic int getFloatIndex(int feature,
int tag_index)
getFloatIndex in interface FloatWeightspublic void init(Model model, java.util.Collection<Sequence> sequences)
init in interface WeightVectorprotected int getSimpleSubMorphIndex(int sub_morph_index)
protected void updateWeight(int index,
double value)
public void updateFloatWeight(int index,
double value)
updateFloatWeight in interface FloatWeightsprotected int getObservedIndex(MorphFeatureVector vector, State state)
protected double applyPenalty(int index,
double weight,
double[] accumulated_penalty)
protected void prepareEncoder()
public void updateWeights(State state, double value, boolean is_transition)
updateWeights in interface WeightVectorpublic void scaleBy(double scale_factor)
scaleBy in interface WeightVectorpublic double[] getWeights()
getWeights in interface WeightVectorpublic void setWeights(double[] weights)
setWeights in interface WeightVectorpublic MorphDictionary getMorphDict()
public double[] getFloatWeights()
getFloatWeights in interface WeightVectorpublic void setFloatWeights(double[] weights)
setFloatWeights in interface WeightVectorpublic MorphModel getModel()
public FeatureTable getFeatureTable()