Class LiMeasure

  • All Implemented Interfaces:
    IMeasure, IEdgeCountingSemanticMeasure

    public class LiMeasure
    extends AEdgeCountingSemanticMeasure
    Implements the Li et al. (LI) 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

      • LiMeasure

        public LiMeasure​(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 LI 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 LI 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