Class WuPalmerMeasure
- java.lang.Object
-
- org.aksw.limes.core.measures.measure.AMeasure
-
- org.aksw.limes.core.measures.measure.semantic.edgecounting.AEdgeCountingSemanticMeasure
-
- org.aksw.limes.core.measures.measure.semantic.edgecounting.measures.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)
-
-
Field Summary
-
Fields inherited from class org.aksw.limes.core.measures.measure.semantic.edgecounting.AEdgeCountingSemanticMeasure
ADJECTIVE_DEPTH, ADVERB_DEPTH, dictionary, Indexer, NOUN_DEPTH, VERB_DEPTH
-
-
Constructor Summary
Constructors Constructor Description WuPalmerMeasure(AIndex Indexer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalculate(ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> synset1Tree, ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> synset2Tree)Calculates the actual WuPalmer similarity.StringgetName()Returns name of a measure.doublegetRuntimeApproximation(double mappingSize)Returns the runtime approximation of a measure.doublegetSimilarityBetweenConcepts(edu.mit.jwi.item.ISynset synset1, edu.mit.jwi.item.ISynset synset2)Computes the WuPalmer similarity between two concepts.StringgetType()Returns type of a measure.-
Methods inherited from class org.aksw.limes.core.measures.measure.semantic.edgecounting.AEdgeCountingSemanticMeasure
checkSimilarity, close, getHierarchyDepth, getIIndexWord, getIWord, getPaths, getSemanticDictionary, getSimilarity, getSimilarity, getSimilarity, getSimilarity, getSynset, getWordIDs, setDictionary, tokenize
-
-
-
-
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 synset1synset2Tree- , 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 synsetsynset2- , the second input synset- Returns:
- the LCH similarity between synset1 and synset2
-
getRuntimeApproximation
public double getRuntimeApproximation(double mappingSize)
Description copied from interface:IMeasureReturns 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:IMeasureReturns name of a measure.- Returns:
- Measure name as a string
-
-