Class WuPalmerMeasure

  • All Implemented Interfaces:
    IMeasure, IEdgeCountingSemanticMeasure

    public class WuPalmerMeasure
    extends AEdgeCountingSemanticMeasure
    Implements the Wu and Palmer (WuPalmer) semantic string similarity between two concepts (synsets), using the path between two concepts and their least common subsumer.
    Version:
    1.0
    Author:
    Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
    • Constructor Detail

      • WuPalmerMeasure

        public WuPalmerMeasure​(AIndex Indexer)
    • Method Detail

      • calculate

        public double calculate​(ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> synset1Tree,
                                ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> synset2Tree)
        Calculates the actual WuPalmer similarity.
        Parameters:
        synset1Tree - , the set of all hypernym paths for a concept synset1
        synset2Tree - , the set of all hypernym paths for a concept synset2
        Returns:
        the LI similarity between two concepts
      • getSimilarityBetweenConcepts

        public double getSimilarityBetweenConcepts​(edu.mit.jwi.item.ISynset synset1,
                                                   edu.mit.jwi.item.ISynset synset2)
        Computes the WuPalmer similarity between two concepts. To do so, it retrieves all possible hypernym paths for the two concepts, finds their least common subsumer concept, calculates the length of the shortest path between the concepts which passes via their least common subsumer.
        Parameters:
        synset1 - , the first input synset
        synset2 - , the second input synset
        Returns:
        the LCH similarity between synset1 and synset2
      • getRuntimeApproximation

        public double getRuntimeApproximation​(double mappingSize)
        Description copied from interface: IMeasure
        Returns the runtime approximation of a measure.
        Parameters:
        mappingSize - , the mapping size returned by the measure
        Returns:
        The runtime of the measure
      • getName

        public String getName()
        Description copied from interface: IMeasure
        Returns name of a measure.
        Returns:
        Measure name as a string
      • getType

        public String getType()
        Description copied from interface: IMeasure
        Returns type of a measure.
        Returns:
        The runtime of the measure