Search in sources :

Example 1 with PRecEvaluator

use of fr.inrialpes.exmo.align.impl.eval.PRecEvaluator in project legato by DOREMUS-ANR.

the class Align method evaluateMappings.

public static void evaluateMappings() throws AlignmentException {
    LEGATO legato = LEGATO.getInstance();
    if (legato.getRefAlign() == null)
        GUI.resultsArea.append("\nNo reference alignment file found !");
    else {
        AlignmentParser parser = new AlignmentParser(0);
        Alignment refAlign = parser.parse((legato.refAlign).toURI());
        Alignment mapFile = parser.parse(new File(legato.getPath() + File.separator + "results.rdf").toURI());
        Properties p = new Properties();
        Evaluator evaluator = new PRecEvaluator(refAlign, mapFile);
        evaluator.eval(p);
        GUI.resultsArea.append("\nEvaluation results:");
        GUI.resultsArea.append("\nF-Measure = " + Math.floor(((PRecEvaluator) evaluator).getFmeasure() * 100) / 100);
        GUI.resultsArea.append("\nPrecision = " + Math.floor(((PRecEvaluator) evaluator).getPrecision() * 100) / 100);
        GUI.resultsArea.append("\nRecall = " + Math.floor(((PRecEvaluator) evaluator).getRecall() * 100) / 100);
    }
}
Also used : Alignment(org.semanticweb.owl.align.Alignment) PRecEvaluator(fr.inrialpes.exmo.align.impl.eval.PRecEvaluator) LEGATO(legato.LEGATO) Properties(java.util.Properties) PRecEvaluator(fr.inrialpes.exmo.align.impl.eval.PRecEvaluator) Evaluator(org.semanticweb.owl.align.Evaluator) File(java.io.File) AlignmentParser(fr.inrialpes.exmo.align.parser.AlignmentParser)

Aggregations

PRecEvaluator (fr.inrialpes.exmo.align.impl.eval.PRecEvaluator)1 AlignmentParser (fr.inrialpes.exmo.align.parser.AlignmentParser)1 File (java.io.File)1 Properties (java.util.Properties)1 LEGATO (legato.LEGATO)1 Alignment (org.semanticweb.owl.align.Alignment)1 Evaluator (org.semanticweb.owl.align.Evaluator)1