moj.ri.weighting
Class RosellsWS

java.lang.Object
  extended by moj.ri.weighting.WeightingScheme
      extended by moj.ri.weighting.RosellsWS
All Implemented Interfaces:
java.io.Serializable

public class RosellsWS
extends WeightingScheme

((1-c) + c*sim) * 2^(1-d)
Note: this will not produce reproducible results in a multi-threaded environment due to the TermFrequency constraint (RandomLabels are not guaranteed to be processed in the same order, and may thus not always reach the threshold at the same point).

Version:
2004-Nov-23
Author:
Magnus Rosell
See Also:
Serialized Form

Field Summary
 float simWeight
           
 
Constructor Summary
RosellsWS()
           
 
Method Summary
 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.
 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.
 
Methods inherited from class moj.ri.weighting.WeightingScheme
setIndex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simWeight

public final float simWeight
See Also:
Constant Field Values
Constructor Detail

RosellsWS

public RosellsWS()
Method Detail

applyLeftWeighting

public float[] applyLeftWeighting(RandomLabel focusLabel,
                                  int distance,
                                  RandomLabel leftContextLabel)
Description copied from class: WeightingScheme
Adds the weighted context label (in the left context) to the focus label's context label and returns it. Application writers must its own methods in a subclass to calculate the weights according to specific algorithms.

Specified by:
applyLeftWeighting in class WeightingScheme
Parameters:
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.
Returns:
the context of the focus word modified according to the weighting scheme.

applyRightWeighting

public float[] applyRightWeighting(RandomLabel focusLabel,
                                   int distance,
                                   RandomLabel rightContextLabel)
Description copied from class: WeightingScheme
Adds the weighted context label (in the right context) to the focus label's context label and returns it. Application writers must its own methods in a subclass to calculate the weights according to specific algorithms.

Specified by:
applyRightWeighting in class WeightingScheme
Parameters:
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.
Returns:
the context of the focus word modified according to the weighting scheme.