Alignment API and Server 4.1.${version.update}

fr.inrialpes.exmo.align.impl.eval
Class ExtPREvaluator

java.lang.Object
  extended by fr.inrialpes.exmo.align.impl.BasicEvaluator
      extended by fr.inrialpes.exmo.align.impl.eval.ExtPREvaluator
All Implemented Interfaces:
Evaluator

public class ExtPREvaluator
extends BasicEvaluator
implements Evaluator

Implements extended precision and recall between alignments. These are the measures corresponding to [Ehrig&Euzenat2005]. The implementation is based on that of PRecEvaluator. This currently (4.1) implements all three mesures with the following changes: - relations are not taken into account (see when there is an algebra of relation with degree of overlap) - functions are parameterised by symALPHA, editALPHA, editBETA, oriented - the distance in the three is measured by param/(d+param) or param^d In the first case (for param=.5): 1, .5, .25, .16, .125 In the second case: 1, .5, .25, .125 - it is possible to avoid using confidences (see below) Dealing with confidence the way this was suggested in [Ehrig&Euzenat2005] may not be a good idea as it seems. Indeed, typically incorrect correspondences are those with low confidence. Hence, when they are close to the target, the fact that the correspondence has a low confidence will penalise heavily the bonus provided by relaxed measures... hence we have introduced a switch for avoiding the confidence computation. This evaluator is far less tolerant than the classical PRecEvaluator because it has to load the ontologies This class is expensive because it computes all similarities together It may be wiser to have different evaluators.

Version:
$Id: ExtPREvaluator.java 1532 2010-10-13 09:26:10Z euzenat $
Author:
Jerome Euzenat

Field Summary
private  double editALPHA
           
private  double editBETA
           
private  double effprec
           
private  double effrec
           
private  double effsimilarity
           
private  int nbexpected
           
private  int nbfound
           
private  HeavyLoadedOntology<Object> onto1
           
private  HeavyLoadedOntology<Object> onto2
           
private  double oriented
           
private  double orientPrecsimilarity
           
private  double orientRecsimilarity
           
private  double precorientprec
           
private  double precorientrec
           
private  double recorientprec
           
private  double recorientrec
           
private  double symALPHA
           
private  double symprec
           
private  double symrec
           
private  double symsimilarity
           
private  boolean withConfidence
           
 
Fields inherited from class fr.inrialpes.exmo.align.impl.BasicEvaluator
align1, align2, result
 
Constructor Summary
ExtPREvaluator(Alignment align1, Alignment align2)
          Creation
 
Method Summary
protected  double computeEffSimilarity(Cell c1, Alignment s2)
          Effort-based relaxed precision and recal similarity Note: it will be better if the parameters were replaced by the actual sibling (choice) Table 3 of [Ehrig2005]
protected  double computePrecisionOrientedSimilarity(Cell c1, Alignment s2)
          Oriented relaxed precision and recal similarity Table 4 (& 5) of [Ehrig2005]
protected  double computeRecallOrientedSimilarity(Cell c1, Alignment s2)
          Oriented relaxed precision and recal similarity Table 6 (& 7) of [Ehrig2005]
protected  double computeSymSimilarity(Cell c1, Alignment s2)
          Symmetric relaxed precision and recal similarity This computes similarity depending on structural measures: the similarity is symALPHA^(val1+val2), symALPHA being lower than 1.
 double eval(Properties params)
          This is a partial implementation of [Ehrig & Euzenat 2005] because the relations are not taken into account (they are supposed to be always =)
 double eval(Properties params, Object cache)
          Run the evaluation between the two ontologies.
 boolean getConfidence()
           
 double getEffPrecision()
           
 double getEffRecall()
           
 double getEffSimilarity()
           
 int getExpected()
           
 int getFound()
           
 double getPrecisionOrientedPrecision()
           
 double getPrecisionOrientedRecall()
           
 double getPrecisionOrientedSimilarity()
           
 double getRecallOrientedPrecision()
           
 double getRecallOrientedRecall()
           
 double getRecallOrientedSimilarity()
           
 Properties getResults()
          Returns the results as a property list not further described but suitable for display.
 double getSymPrecision()
           
 double getSymRecall()
           
 double getSymSimilarity()
           
 int isSuperClass(Object class1, Object class2, HeavyLoadedOntology<Object> ontology)
          This is a strange method which returns an integer representing how directly a class is superclass of another or not.
 int isSuperProperty(Object prop1, Object prop2, HeavyLoadedOntology<Object> ontology)
           
protected  int relativePosition(Object o1, Object o2, HeavyLoadedOntology<Object> onto)
          Returns the relative position of two entities: 0: unrelated n: o1 is a n-step sub-entity of o2 -n: o2 is a n-step sub-entity of o1
 void setConfidence(boolean b)
           
 int superClassPosition(Object class1, Object class2, HeavyLoadedOntology<Object> onto)
           
 int superPropertyPosition(Object prop1, Object prop2, HeavyLoadedOntology<Object> onto)
           
 void write(PrintWriter writer)
          This now output the results in Lockheed format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onto1

private HeavyLoadedOntology<Object> onto1

onto2

private HeavyLoadedOntology<Object> onto2

symALPHA

private double symALPHA

editALPHA

private double editALPHA

editBETA

private double editBETA

oriented

private double oriented

symprec

private double symprec

symrec

private double symrec

effprec

private double effprec

effrec

private double effrec

precorientprec

private double precorientprec

precorientrec

private double precorientrec

recorientprec

private double recorientprec

recorientrec

private double recorientrec

nbexpected

private int nbexpected

nbfound

private int nbfound

symsimilarity

private double symsimilarity

effsimilarity

private double effsimilarity

orientPrecsimilarity

private double orientPrecsimilarity

orientRecsimilarity

private double orientRecsimilarity

withConfidence

private boolean withConfidence
Constructor Detail

ExtPREvaluator

public ExtPREvaluator(Alignment align1,
                      Alignment align2)
               throws AlignmentException
Creation

Throws:
AlignmentException
Method Detail

setConfidence

public void setConfidence(boolean b)

getConfidence

public boolean getConfidence()

getSymPrecision

public double getSymPrecision()

getSymRecall

public double getSymRecall()

getSymSimilarity

public double getSymSimilarity()

getEffPrecision

public double getEffPrecision()

getEffRecall

public double getEffRecall()

getEffSimilarity

public double getEffSimilarity()

getPrecisionOrientedPrecision

public double getPrecisionOrientedPrecision()

getPrecisionOrientedRecall

public double getPrecisionOrientedRecall()

getRecallOrientedPrecision

public double getRecallOrientedPrecision()

getRecallOrientedRecall

public double getRecallOrientedRecall()

getPrecisionOrientedSimilarity

public double getPrecisionOrientedSimilarity()

getRecallOrientedSimilarity

public double getRecallOrientedSimilarity()

getExpected

public int getExpected()

getFound

public int getFound()

eval

public double eval(Properties params)
            throws AlignmentException
This is a partial implementation of [Ehrig & Euzenat 2005] because the relations are not taken into account (they are supposed to be always =)

Specified by:
eval in interface Evaluator
Throws:
AlignmentException

eval

public double eval(Properties params,
                   Object cache)
            throws AlignmentException
Description copied from interface: Evaluator
Run the evaluation between the two ontologies. Returns a double (between 0 and 1) providing an idea of the proximity The additional argument allows to cache the ontologies if necessary //@deprecated The OntologyCache is now internal, use eval( params ) instead

Specified by:
eval in interface Evaluator
Throws:
AlignmentException

computeSymSimilarity

protected double computeSymSimilarity(Cell c1,
                                      Alignment s2)
Symmetric relaxed precision and recal similarity This computes similarity depending on structural measures: the similarity is symALPHA^(val1+val2), symALPHA being lower than 1. valx is the length of the subclass chain. Table 1 (& 2) of [Ehrig2005]


computeEffSimilarity

protected double computeEffSimilarity(Cell c1,
                                      Alignment s2)
Effort-based relaxed precision and recal similarity Note: it will be better if the parameters were replaced by the actual sibling (choice) Table 3 of [Ehrig2005]


computePrecisionOrientedSimilarity

protected double computePrecisionOrientedSimilarity(Cell c1,
                                                    Alignment s2)
Oriented relaxed precision and recal similarity Table 4 (& 5) of [Ehrig2005]


computeRecallOrientedSimilarity

protected double computeRecallOrientedSimilarity(Cell c1,
                                                 Alignment s2)
Oriented relaxed precision and recal similarity Table 6 (& 7) of [Ehrig2005]


relativePosition

protected int relativePosition(Object o1,
                               Object o2,
                               HeavyLoadedOntology<Object> onto)
                        throws AlignmentException
Returns the relative position of two entities: 0: unrelated n: o1 is a n-step sub-entity of o2 -n: o2 is a n-step sub-entity of o1

Throws:
AlignmentException

superClassPosition

public int superClassPosition(Object class1,
                              Object class2,
                              HeavyLoadedOntology<Object> onto)
                       throws AlignmentException
Throws:
AlignmentException

isSuperClass

public int isSuperClass(Object class1,
                        Object class2,
                        HeavyLoadedOntology<Object> ontology)
                 throws AlignmentException
This is a strange method which returns an integer representing how directly a class is superclass of another or not. This would require computing the transitive reduction of the superClass relation which is currently returned by HeavyLoadedOntology.

Throws:
AlignmentException

superPropertyPosition

public int superPropertyPosition(Object prop1,
                                 Object prop2,
                                 HeavyLoadedOntology<Object> onto)
                          throws AlignmentException
Throws:
AlignmentException

isSuperProperty

public int isSuperProperty(Object prop1,
                           Object prop2,
                           HeavyLoadedOntology<Object> ontology)
                    throws AlignmentException
Throws:
AlignmentException

write

public void write(PrintWriter writer)
           throws IOException
This now output the results in Lockheed format.

Specified by:
write in interface Evaluator
Overrides:
write in class BasicEvaluator
Throws:
IOException

getResults

public Properties getResults()
Description copied from interface: Evaluator
Returns the results as a property list not further described but suitable for display.

Specified by:
getResults in interface Evaluator

Alignment API and Server 4.1.${version.update}

(C) INRIA & friends, 2003-${curryear}