Mentions légales du service

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

i- changed metadata for keyword expansion

parent e431e20e
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<type>11</type> <type>11</type>
<uri1>http://www.example.org/ontology1</uri1> <uri1>http://www.example.org/ontology1</uri1>
<uri2>http://www.example.org/ontology2</uri2> <uri2>http://www.example.org/ontology2</uri2>
<onto1>file://./rdf/onto1.owl</onto1> <onto1>file://localhost/Volumes/Phata/JAVA/alignapi/rdf/onto1.owl</onto1>
<onto2>file://./rdf/onto2.owl</onto2> <onto2>file://localhost/Volumes/Phata/JAVA/alignapi/rdf/onto2.owl</onto2>
<map> <map>
<Cell> <Cell>
<entity1 rdf:resource='http://www.example.org/ontology1#journalarticle'/> <entity1 rdf:resource='http://www.example.org/ontology1#journalarticle'/>
......
...@@ -300,24 +300,6 @@ public class GenPlot { ...@@ -300,24 +300,6 @@ public class GenPlot {
output.println("\\begin{document}"); output.println("\\begin{document}");
output.println("\\date{today}"); output.println("\\date{today}");
output.println(""); output.println("");
output.println("\\pgfuseplotmark{-}");
output.println("\\pgfuseplotmark{|}");
output.println("\\pgfuseplotmark{o}");
output.println("\\pgfuseplotmark{asterisk}");
output.println("\\pgfuseplotmark{star}");
output.println("\\pgfuseplotmark{oplus}");
output.println("\\pgfuseplotmark{oplus*}");
output.println("\\pgfuseplotmark{otimes}");
output.println("\\pgfuseplotmark{otimes*}");
output.println("\\pgfuseplotmark{square}");
output.println("\\pgfuseplotmark{square*}");
output.println("\\pgfuseplotmark{triangle}");
output.println("\\pgfuseplotmark{triangle*}");
output.println("\\pgfuseplotmark{diamond}");
output.println("\\pgfuseplotmark{diamond*}");
output.println("\\pgfuseplotmark{pentagon}");
output.println("\\pgfuseplotmark{pentagon*}");
output.println("");
output.println("\n%% Plot generated by GenPlot of alignapi"); output.println("\n%% Plot generated by GenPlot of alignapi");
output.println("\\begin{tikzpicture}[cap=round]"); output.println("\\begin{tikzpicture}[cap=round]");
output.println("% Draw grid"); output.println("% Draw grid");
......
...@@ -44,6 +44,7 @@ import java.io.FileOutputStream; ...@@ -44,6 +44,7 @@ import java.io.FileOutputStream;
import java.net.URI; import java.net.URI;
import java.lang.Double; import java.lang.Double;
import java.lang.Integer; import java.lang.Integer;
import java.lang.Math;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Vector; import java.util.Vector;
import java.util.Enumeration; import java.util.Enumeration;
...@@ -282,6 +283,90 @@ public class GroupEval { ...@@ -282,6 +283,90 @@ public class GroupEval {
public static void print( Vector result ) { public static void print( Vector result ) {
if ( type.equals("html") ) printHTML( result ); if ( type.equals("html") ) printHTML( result );
else if ( type.equals("tex") ) printLATEX( result ); else if ( type.equals("tex") ) printLATEX( result );
else if ( type.equals("triangle") ) printTRIANGLE( result );
}
public static void printTRIANGLE( Vector result ) {
// variables for computing iterative harmonic means
int expected = 0; // expected so far
int foundVect[]; // found so far
int correctVect[]; // correct so far
long timeVect[]; // time so far
double hMeansPrec[]; // Precision H-means so far
double hMeansRec[]; // Recall H-means so far
foundVect = new int[ listAlgo.size() ];
correctVect = new int[ listAlgo.size() ];
timeVect = new long[ listAlgo.size() ];
hMeansPrec = new double[ listAlgo.size() ];
hMeansRec = new double[ listAlgo.size() ];
for( int k = listAlgo.size()-1; k >= 0; k-- ) {
foundVect[k] = 0;
correctVect[k] = 0;
timeVect[k] = 0;
hMeansPrec[k] = 1.;
hMeansRec[k] = 1.;
}
for ( Enumeration e = result.elements() ; e.hasMoreElements() ;) {
int nexpected = -1;
int oexpected = 0;
Vector test = (Vector)e.nextElement();
Enumeration f = test.elements();
f.nextElement();
for( int k = 0 ; f.hasMoreElements() ; k++) {
PRecEvaluator eval = (PRecEvaluator)f.nextElement();
if ( eval != null ){
// iterative H-means computation
if ( nexpected == -1 ){
nexpected = eval.getExpected();
oexpected = expected;
expected = oexpected + nexpected;
}
int nfound = eval.getFound();
int ofound = foundVect[k];
foundVect[k] = ofound + nfound;
int ncorrect = eval.getCorrect();
int ocorrect = correctVect[k];
correctVect[k] = ocorrect + ncorrect;
timeVect[k] += eval.getTime();
}
}
}
System.out.println("\\documentclass[11pt]{book}");
System.out.println();
System.out.println("\\usepackage{pgf}");
System.out.println("\\usepackage{tikz}");
System.out.println();
System.out.println("\\begin{document}");
System.out.println("\\date{today}");
System.out.println("");
System.out.println("\n%% Plot generated by GenPlot of alignapi");
System.out.println("\\begin{tikzpicture}[cap=round]");
System.out.println("% Draw grid");
System.out.println("\\draw[step=1cm,very thin,color=gray] (-0.2,-0.2) grid (10.0,9.0);");
System.out.println("\\draw[|-|] (-0,0) -- (10,0);");
System.out.println("%\\draw[dashed,very thin] (0,0) -- (5,8.66) -- (10,0);");
System.out.println("\\draw[dashed,very thin] (10,0) arc (0:60:10cm);");
System.out.println("\\draw[dashed,very thin] (0,0) arc (180:120:10cm);");
System.out.println("\\draw (0,-0.3) node {$recall$}; ");
System.out.println("\\draw (10,-0.3) node {$precision$}; ");
//System.out.println("\\draw (0,-0.3) node {0.}; ");
//System.out.println("\\draw (10,-0.3) node {1.}; ");
System.out.println("% Plots");
int k = 0;
for ( Enumeration e = listAlgo.elements() ; e.hasMoreElements() ; k++) {
double precision = (double)correctVect[k]/foundVect[k];
double recall = (double)correctVect[k]/expected;
double prec2 = precision*precision;
double a = ((prec2-(recall*recall)+1)/2);
double b = java.lang.Math.sqrt( prec2 - (a*a) );
a = a*10; b = b*10; //for printing scale 10.
System.out.println("\\draw plot[mark=+,] coordinates {("+a+","+b+")};");
System.out.println("\\draw ("+(a+.01)+","+(b+.01)+") node[anchor=south west] {"+(String)e.nextElement()+"};");
}
System.out.println("\\end{tikzpicture}");
System.out.println();
System.out.println("\\end{document}");
} }
public static void printLATEX( Vector result ) { public static void printLATEX( Vector result ) {
...@@ -297,6 +382,8 @@ public class GroupEval { ...@@ -297,6 +382,8 @@ public class GroupEval {
double hMeansRec[]; // Recall H-means so far double hMeansRec[]; // Recall H-means so far
PrintStream writer = null; PrintStream writer = null;
fsize = format.length(); fsize = format.length();
// JE: the writer should be put out
// JE: the h-means computation should be put out as well
try { try {
// Print result // Print result
if ( filename == null ) { if ( filename == null ) {
...@@ -480,7 +567,7 @@ public class GroupEval { ...@@ -480,7 +567,7 @@ public class GroupEval {
System.out.println("\t--output=filename -o filename\tSpecifies a file to which the output will go"); System.out.println("\t--output=filename -o filename\tSpecifies a file to which the output will go");
System.out.println("\t--reference=filename -r filename\tSpecifies the name of the reference alignment file (default: refalign.rdf)"); System.out.println("\t--reference=filename -r filename\tSpecifies the name of the reference alignment file (default: refalign.rdf)");
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|triangle -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");
System.out.println("\t--color=color -c color\tSpecifies if the output must color even lines of the output"); System.out.println("\t--color=color -c color\tSpecifies if the output must color even lines of the output");
System.out.println("\t--debug[=n] -d [n]\t\tReport debug info at level n"); System.out.println("\t--debug[=n] -d [n]\t\tReport debug info at level n");
......
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