moj.ri.weighting
Class PermutatingWS

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

public class PermutatingWS
extends WeightingScheme

Instead of weighting the context labels e.g. by distance to the focus word, the context labels are shifted as many steps to the left or right as the token distance to the focus word. This way we generate word order dependent context vectors, see further:
Sahlgren, M., Holst, A. & Kanerva, P. (2008): Permutations as a Means to Encode Order in Word Space. Proceedings of the 30th Annual Meeting of the Cognitive Science Society (CogSci'08), July 23-26, Washington D.C., USA.

Version:
2011-Sept-23
Author:
Martin Hassel
See Also:
Serialized Form

Constructor Summary
PermutatingWS()
           
 
Method Summary
 float[] applyLeftWeighting(RandomLabel focusLabel, int distance, RandomLabel leftContextLabel)
          Word order is captured by use of permutations.
 float[] applyRightWeighting(RandomLabel focusLabel, int distance, RandomLabel rightContextLabel)
          Word order is captured by use of permutations.
 
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
 

Constructor Detail

PermutatingWS

public PermutatingWS()
Method Detail

applyLeftWeighting

public float[] applyLeftWeighting(RandomLabel focusLabel,
                                  int distance,
                                  RandomLabel leftContextLabel)
Word order is captured by use of permutations.

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 update the focusLabel.
Returns:
the context of the focus word modified according to the weighting scheme.

applyRightWeighting

public float[] applyRightWeighting(RandomLabel focusLabel,
                                   int distance,
                                   RandomLabel rightContextLabel)
Word order is captured by use of permutations.

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 update the focusLabel.
Returns:
the context of the focus word modified according to the weighting scheme.