Class ShortestPathMeasure

  • All Implemented Interfaces:
    IMeasure, IEdgeCountingSemanticMeasure

    public class ShortestPathMeasure
    extends AEdgeCountingSemanticMeasure
    Implements the Shortest Path semantic string similarity between two concepts (synsets), that considers both the path between two concepts and the depth of the hierarchy.
    Version:
    1.0
    Author:
    Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
    • Constructor Detail

      • ShortestPathMeasure

        public ShortestPathMeasure​(AIndex Indexer)
    • Method Detail

      • calculate

        public double calculate​(edu.mit.jwi.item.ISynset synset1,
                                double shortestPath)
        Calculates the actual Shortest Path similarity.
        Parameters:
        synset1 - , an input concept, used to retrieve the depth of the corresponding hierarchy
        shortestPath - , the length of the shortest path between two concepts
        Returns:
        the Shortest Path similarity between two concepts
      • getSimilarityBetweenConcepts

        public double getSimilarityBetweenConcepts​(edu.mit.jwi.item.ISynset synset1,
                                                   edu.mit.jwi.item.ISynset synset2)
        Computes the Shortest Path similarity between two concepts. It retrieves all possible hypernym paths for the two concepts and finds the shortest path between two concepts 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