|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmoj.ri.weighting.WeightingScheme
public abstract class WeightingScheme
Calculates the weighting of the context label.
All subclasses of WeightingScheme
must provide methods
for calculating the weights for left and right context windows according
to the desired algorithm (for example using distance to context label).
If there is a need to be able to serialize the RandomIndex
, all
subclasses of WeightingScheme
must declare their own
serialVersionUID
.
Constructor Summary | |
---|---|
WeightingScheme()
|
Method Summary | |
---|---|
abstract float[] |
applyLeftWeighting(RandomLabel focusLabel,
int distance,
RandomLabel leftContextLabel)
Adds the weighted context label (in the left context) to the focus label's context label and returns it. |
abstract float[] |
applyRightWeighting(RandomLabel focusLabel,
int distance,
RandomLabel rightContextLabel)
Adds the weighted context label (in the right context) to the focus label's context label and returns it. |
void |
setIndex(RandomIndex index)
The RandomIndex the WeightingScheme is used for
so that extending schemes can use information kept by the index, e.g. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeightingScheme()
Method Detail |
---|
public void setIndex(RandomIndex index)
RandomIndex
the WeightingScheme
is used for
so that extending schemes can use information kept by the index, e.g. the
number of words or documents indexed so far.
index
- a RandomIndex
, typically the one the
WeightingScheme
is used forpublic abstract float[] applyLeftWeighting(RandomLabel focusLabel, int distance, RandomLabel leftContextLabel)
focusLabel
- RandomLabel in focus, i.e. the focus word whose context vector
should be modified with the weighted RandomLabel in left context.distance
- leftward distance to the focus word (RandomLabel).leftContextLabel
- RandomLabel in left context at distance
from
the focus word, which can be used together with distance
to
calculate the weight.
public abstract float[] applyRightWeighting(RandomLabel focusLabel, int distance, RandomLabel rightContextLabel)
focusLabel
- RandomLabel in focus, i.e. the focus word whose context vector
should be modified with the weighted RandomLabel in right context.distance
- rightward distance to the focus word (RandomLabel).rightContextLabel
- RandomLabel in right context at distance
from
the focus word, which can be used together with distance
to
calculate the weight.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |