Mentions légales du service

Skip to content
Snippets Groups Projects
Commit f19b66ed authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- improved LaTeX rendering of PRGRaphs (not perfect yet but close)

- cleaned up some copyright notices
- investigated the PRGraph evaluator algorithm (and make it start at 1/0)
parent 80d3d692
No related branches found
No related tags found
No related merge requests found
...@@ -35,10 +35,12 @@ ...@@ -35,10 +35,12 @@
<h2>Current SVN trunk version</h2> <h2>Current SVN trunk version</h2>
<p><ul compact="1"> <p><ul compact="1">
<li>Adding HTML Alignement server profile (under development)</li>
<li>Adding SQL storage support (under development)</li>
<li>Adding Alignement server (under development)</li> <li>Adding Alignement server (under development)</li>
<li>Adding SQL storage support (under development)</li>
<li>Adding HTML Alignement server profile (under development)</li>
<li>Suppressed outdated "tutorial" from repository (see html/tutorial)</li>
<li>Corrected Cell id rendering/parse in RDF/XML (rdf:about)</li> <li>Corrected Cell id rendering/parse in RDF/XML (rdf:about)</li>
<li>Improved Precision/recall graph rendering in LaTeX</li>
</ul></p> </ul></p>
<h2>July 10th, 2006</h2> <h2>July 10th, 2006</h2>
......
...@@ -152,6 +152,7 @@ public class PRGraphEvaluator extends BasicEvaluator { ...@@ -152,6 +152,7 @@ public class PRGraphEvaluator extends BasicEvaluator {
// Collect the points that change recall // Collect the points that change recall
// (the other provide lower precision from the same recall // (the other provide lower precision from the same recall
// and are not considered) // and are not considered)
points.add( new Pair( 0., 1. ) );
for( Iterator it = cellSet.iterator(); it.hasNext(); ){ for( Iterator it = cellSet.iterator(); it.hasNext(); ){
nbfound++; nbfound++;
Cell c2 = (Cell)it.next(); Cell c2 = (Cell)it.next();
...@@ -175,6 +176,12 @@ public class PRGraphEvaluator extends BasicEvaluator { ...@@ -175,6 +176,12 @@ public class PRGraphEvaluator extends BasicEvaluator {
} }
} }
} }
// Now if we want to have a regular curve we must penalize those system
// that do not reach 100% recall.
// for that purpose, and for each other bound we add a point with the worse
// precision which is the required recall level divided with the maximum
// cardinality possible (i.e., the multiplication of the ontology sizes).
points.add( new Pair( 1.0, 0. ) ); // useless because
// Interpolate curve points at each n-recall level // Interpolate curve points at each n-recall level
// This is inspired form Ray Mooney's program // This is inspired form Ray Mooney's program
...@@ -194,7 +201,7 @@ public class PRGraphEvaluator extends BasicEvaluator { ...@@ -194,7 +201,7 @@ public class PRGraphEvaluator extends BasicEvaluator {
if ( precrec.getY() > best ) best = precrec.getY(); if ( precrec.getY() > best ) best = precrec.getY();
j--; j--;
} }
precisions[0] = best; precisions[0] = best; // It should be 1. that's why it is now added in points.
return 0.0; // useless return 0.0; // useless
} }
......
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
* Copyright (C) 2003-2005, INRIA Rhne-Alpes * Copyright (C) 2003-2005, INRIA Rhne-Alpes
* Copyright (C) 2004, Universit de Montral * Copyright (C) 2004, Universit de Montral
* *
* Modifications to the initial code base are copyright of their
* respective authors, or their employers as appropriate. Authorship
* of the modifications may be determined from the ChangeLog placed at
* the end of this file.
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of * as published by the Free Software Foundation; either version 2.1 of
...@@ -28,6 +23,8 @@ ...@@ -28,6 +23,8 @@
*/ */
/* This program evaluates the results of several ontology aligners in a row. /* This program evaluates the results of several ontology aligners in a row.
It uses the generalisations of precision and recall described in
[Ehrig & Euzenat 2005].
*/ */
package fr.inrialpes.exmo.align.util; package fr.inrialpes.exmo.align.util;
...@@ -61,12 +58,13 @@ import gnu.getopt.Getopt; ...@@ -61,12 +58,13 @@ import gnu.getopt.Getopt;
import fr.inrialpes.exmo.align.parser.AlignmentParser; import fr.inrialpes.exmo.align.parser.AlignmentParser;
/** A basic class for synthesizing the results of a set of alignments provided by /** A basic class for synthesizing the results of a set of alignments provided
different algorithms. The output is a table showing various classical measures by different algorithms. The output is a table showing various generalisations
for each test and for each algorithm. Average is also computed as Harmonic means. of precision and recall for each test and for each algorithm.
Average is also computed as Harmonic means.
<pre> <pre>
java -cp procalign.jar fr.inrialpes.exmo.align.util.GroupEval [options] java -cp procalign.jar fr.inrialpes.exmo.align.util.ExtGroupEval [options]
</pre> </pre>
where the options are: where the options are:
...@@ -79,12 +77,13 @@ import fr.inrialpes.exmo.align.parser.AlignmentParser; ...@@ -79,12 +77,13 @@ import fr.inrialpes.exmo.align.parser.AlignmentParser;
-t output --type=output: xml/tex/html/ascii -t output --type=output: xml/tex/html/ascii
</pre> </pre>
The input is taken in the current directory in a set of subdirectories (one per The input is taken in the current directory in a set of subdirectories
test which will be rendered by a line) each directory contains a number of (one per test which will be rendered by a line) each directory contains
alignment files (one per algorithms which will be renderer as a column). a number of alignment files (one per algorithms which will be renderer
as a column).
If output is requested (<CODE>-o</CODE> flags), then output will be written to If output is requested (<CODE>-o</CODE> flags), then output will be
<CODE>output</CODE> if present, stdout by default. written to <CODE>output</CODE> if present, stdout by default.
<pre> <pre>
$Id$ $Id$
...@@ -430,7 +429,7 @@ public class ExtGroupEval { ...@@ -430,7 +429,7 @@ public class ExtGroupEval {
public static void usage() { public static void usage() {
System.out.println("usage: ExtGroupEval [options]"); System.out.println("usage: ExtGroupEval [options]");
System.out.println("options are:"); System.out.println("options are:");
System.out.println("\t--format=prfmo -r prfmo\tSpecifies the output order (symetric/effort-based/oriented)"); System.out.println("\t--format=seo -r seo\tSpecifies the extended measure used (symetric/effort-based/oriented)");
System.out.println("\t--dominant=algo -s algo\tSpecifies if dominant columns are algorithms or measure"); System.out.println("\t--dominant=algo -s algo\tSpecifies if dominant columns are algorithms or measure");
System.out.println("\t--type=html|xml|tex|ascii -t html|xml|tex|ascii\tSpecifies the output format"); System.out.println("\t--type=html|xml|tex|ascii -t html|xml|tex|ascii\tSpecifies the output format");
System.out.println("\t--list=algo1,...,algon -l algo1,...,algon\tSequence of the filenames to consider"); System.out.println("\t--list=algo1,...,algon -l algo1,...,algon\tSequence of the filenames to consider");
......
...@@ -3,14 +3,9 @@ ...@@ -3,14 +3,9 @@
* *
* Copyright (C) 2003 The University of Manchester * Copyright (C) 2003 The University of Manchester
* Copyright (C) 2003 The University of Karlsruhe * Copyright (C) 2003 The University of Karlsruhe
* Copyright (C) 2003-2005, INRIA Rhne-Alpes * Copyright (C) 2003-2006, INRIA Rhne-Alpes
* Copyright (C) 2004, Universit de Montral * Copyright (C) 2004, Universit de Montral
* *
* Modifications to the initial code base are copyright of their
* respective authors, or their employers as appropriate. Authorship
* of the modifications may be determined from the ChangeLog placed at
* the end of this file.
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of * as published by the Free Software Foundation; either version 2.1 of
...@@ -295,12 +290,12 @@ public class GenPlot { ...@@ -295,12 +290,12 @@ public class GenPlot {
public static void printPGFTex( double[][] result ){ public static void printPGFTex( double[][] result ){
int i = 0; int i = 0;
String marktable[] = { "+", "*", "x", "-", "|", "o", "asterisk", "star", "oplus", "oplus*", "otimes", "otimes*", "square", "square*", "triangle", "triangle*", "diamond", "diamond*", "pentagon", "pentagon*"}; String marktable[] = { "+", "*", "x", "-", "|", "o", "asterisk", "star", "oplus", "oplus*", "otimes", "otimes*", "square", "square*", "triangle", "triangle*", "diamond", "diamond*", "pentagon", "pentagon*"};
String colortable[] = { "black", "white", "red", "green", "blue", "cyan", "magenta", "yellow" } ; String colortable[] = { "black", "red", "green", "blue", "cyan", "magenta", "yellow" } ;
output.println("\\documentclass[11pt]{book}"); output.println("\\documentclass[11pt]{book}");
output.println(); output.println();
output.println("\\usepackage{pgflibraryplotmarks}");
output.println("\\usepackage{pgf}"); output.println("\\usepackage{pgf}");
output.println("\\usepackage{tikz}"); output.println("\\usepackage{tikz}");
output.println("\\usepackage{pgflibraryplotmarks}");
output.println(); output.println();
output.println("\\begin{document}"); output.println("\\begin{document}");
output.println("\\date{today}"); output.println("\\date{today}");
...@@ -327,19 +322,25 @@ public class GenPlot { ...@@ -327,19 +322,25 @@ public class GenPlot {
output.println("\\begin{tikzpicture}[cap=round]"); output.println("\\begin{tikzpicture}[cap=round]");
output.println("% Draw grid"); output.println("% Draw grid");
output.println("\\draw[step="+(STEP/10)+"cm,very thin,color=gray] (-0.2,-0.2) grid ("+STEP+","+STEP+");"); output.println("\\draw[step="+(STEP/10)+"cm,very thin,color=gray] (-0.2,-0.2) grid ("+STEP+","+STEP+");");
output.println("\\draw[->] (-0.2,0) -- (10.2,0) node[below] {$recall$}; "); output.println("\\draw[->] (-0.2,0) -- (10.2,0);");
output.println("\\draw (5,-0.3) node {$recall$}; ");
output.println("\\draw (0,-0.3) node {0.}; "); output.println("\\draw (0,-0.3) node {0.}; ");
output.println("\\draw (10,-0.3) node {1.}; "); output.println("\\draw (10,-0.3) node {1.}; ");
output.println("\\draw[->] (0,-0.2) -- (0,10.2) node[above] {$precision$}; "); output.println("\\draw[->] (0,-0.2) -- (0,10.2);");
output.println("\\draw (-0.3,0) node {0.}; "); output.println("\\draw (-0.3,0) node {0.}; ");
output.println("\\draw (-0.3,5) node[rotate=90] {$precision$}; ");
output.println("\\draw (-0.3,10) node {1.}; "); output.println("\\draw (-0.3,10) node {1.}; ");
output.println("% Plots"); output.println("% Plots");
for ( Enumeration e = listAlgo.elements() ; e.hasMoreElements() ; i++) { for ( Enumeration e = listAlgo.elements() ; e.hasMoreElements() ; i++) {
output.println("\\draw["+colortable[i%8]+"] plot[mark="+marktable[i%20]+",smooth] file {"+(String)e.nextElement()+".table};"); output.println("\\draw["+colortable[i%7]+"] plot[mark="+marktable[i%19]+",smooth] file {"+(String)e.nextElement()+".table};");
//output.println("\\draw plot[mark=+,smooth] file {"+(String)e.nextElement()+".table};");
} }
// And a legend // And a legend
output.println("% Legend"); output.println("% Legend");
i = 0;
for ( Enumeration e = listAlgo.elements() ; e.hasMoreElements() ; i++) {
output.println("\\draw["+colortable[i%7]+"] plot[mark="+marktable[i%19]+",smooth] coordinates {("+((i%3)*3+1)+","+(-(i/3)*.8-1)+") ("+((i%3)*3+3)+","+(-(i/3)*.8-1)+")};");
output.println("\\draw["+colortable[i%7]+"] ("+((i%3)*3+2)+","+(-(i/3)*.8-.8)+") node {"+(String)e.nextElement()+"};");
}
output.println("\\end{tikzpicture}"); output.println("\\end{tikzpicture}");
output.println(); output.println();
output.println("\\end{document}"); output.println("\\end{document}");
...@@ -361,8 +362,8 @@ public class GenPlot { ...@@ -361,8 +362,8 @@ public class GenPlot {
writer.println("%% Include in PGF tex by:\n"); writer.println("%% Include in PGF tex by:\n");
writer.println("%% \\begin{tikzpicture}[cap=round]"); writer.println("%% \\begin{tikzpicture}[cap=round]");
writer.println("%% \\draw[step="+(STEP/10)+"cm,very thin,color=gray] (-0.2,-0.2) grid ("+STEP+","+STEP+");"); writer.println("%% \\draw[step="+(STEP/10)+"cm,very thin,color=gray] (-0.2,-0.2) grid ("+STEP+","+STEP+");");
writer.println("%% \\draw[->] (-0.2,0) -- (10.2,0) node[right] {$precision$}; "); writer.println("%% \\draw[->] (-0.2,0) -- (10.2,0) node[right] {$recall$}; ");
writer.println("%% \\draw[->] (0,-0.2) -- (0,10.2) node[above] {$recall$}; "); writer.println("%% \\draw[->] (0,-0.2) -- (0,10.2) node[above] {$precision$}; ");
writer.println("%% \\draw plot[mark=+,smooth] file {"+algo+".table};"); writer.println("%% \\draw plot[mark=+,smooth] file {"+algo+".table};");
writer.println("%% \\end{tikzpicture}"); writer.println("%% \\end{tikzpicture}");
writer.println(); writer.println();
......
...@@ -3,14 +3,9 @@ ...@@ -3,14 +3,9 @@
* *
* Copyright (C) 2003 The University of Manchester * Copyright (C) 2003 The University of Manchester
* Copyright (C) 2003 The University of Karlsruhe * Copyright (C) 2003 The University of Karlsruhe
* Copyright (C) 2003-2005, INRIA Rhne-Alpes * Copyright (C) 2003-2006, INRIA Rhne-Alpes
* Copyright (C) 2004, Universit de Montral * Copyright (C) 2004, Universit de Montral
* *
* Modifications to the initial code base are copyright of their
* respective authors, or their employers as appropriate. Authorship
* of the modifications may be determined from the ChangeLog placed at
* the end of this file.
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of * as published by the Free Software Foundation; either version 2.1 of
...@@ -103,6 +98,7 @@ public class GroupEval { ...@@ -103,6 +98,7 @@ public class GroupEval {
static String format = "pr"; static String format = "pr";
static int fsize = 2; static int fsize = 2;
static String type = "html"; static String type = "html";
static boolean embedded = false;
static String dominant = "s"; static String dominant = "s";
static Vector listAlgo = null; static Vector listAlgo = null;
static int debug = 0; static int debug = 0;
...@@ -284,6 +280,14 @@ public class GroupEval { ...@@ -284,6 +280,14 @@ public class GroupEval {
* This does not only print the results but compute the average as well * This does not only print the results but compute the average as well
*/ */
public static void print( Vector result ) { public static void print( Vector result ) {
if ( type.equals("html") ) printHTML( result );
else if ( type.equals("tex") ) printLATEX( result );
}
public static void printLATEX( Vector result ) {
}
public static void printHTML( Vector result ) {
// variables for computing iterative harmonic means // variables for computing iterative harmonic means
int expected = 0; // expected so far int expected = 0; // expected so far
int foundVect[]; // found so far int foundVect[]; // found so far
...@@ -301,7 +305,7 @@ public class GroupEval { ...@@ -301,7 +305,7 @@ public class GroupEval {
writer = new PrintStream(new FileOutputStream( filename )); writer = new PrintStream(new FileOutputStream( filename ));
} }
// Print the header // Print the header
writer.println("<html><head></head><body>"); if ( embedded != true ) writer.println("<html><head></head><body>");
writer.println("<table border='2' frame='sides' rules='groups'>"); writer.println("<table border='2' frame='sides' rules='groups'>");
writer.println("<colgroup align='center' />"); writer.println("<colgroup align='center' />");
// for each algo <td spancol='2'>name</td> // for each algo <td spancol='2'>name</td>
...@@ -442,7 +446,7 @@ public class GroupEval { ...@@ -442,7 +446,7 @@ public class GroupEval {
} }
writer.println("</tr>"); writer.println("</tr>");
writer.println("</tbody></table>"); writer.println("</tbody></table>");
writer.println("</body></html>"); if ( embedded != true ) writer.println("</body></html>");
writer.close(); writer.close();
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
......
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
* Copyright (C) 2003-2006, INRIA Rhne-Alpes * Copyright (C) 2003-2006, INRIA Rhne-Alpes
* Copyright (C) 2004, Universit de Montral * Copyright (C) 2004, Universit de Montral
* *
* Modifications to the initial code base are copyright of their
* respective authors, or their employers as appropriate. Authorship
* of the modifications may be determined from the ChangeLog placed at
* the end of this file.
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of * as published by the Free Software Foundation; either version 2.1 of
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment