Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moex
Alignment API
Commits
81721c6f
Commit
81721c6f
authored
14 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- Skeleton for a diff evaluator
parent
1a041dba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fr/inrialpes/exmo/align/impl/eval/DiffEvaluator.java
+117
-0
117 additions, 0 deletions
src/fr/inrialpes/exmo/align/impl/eval/DiffEvaluator.java
with
117 additions
and
0 deletions
src/fr/inrialpes/exmo/align/impl/eval/DiffEvaluator.java
0 → 100644
+
117
−
0
View file @
81721c6f
/*
* $Id: DiffEvaluator.java 1425 2010-04-06 20:25:39Z euzenat $
*
* Copyright (C) INRIA, 2010
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package
fr.inrialpes.exmo.align.impl.eval
;
import
org.semanticweb.owl.align.Alignment
;
import
org.semanticweb.owl.align.AlignmentException
;
import
org.semanticweb.owl.align.Cell
;
import
org.semanticweb.owl.align.Evaluator
;
import
fr.inrialpes.exmo.align.parser.SyntaxElement
;
import
fr.inrialpes.exmo.align.impl.Namespace
;
import
fr.inrialpes.exmo.align.impl.BasicEvaluator
;
import
fr.inrialpes.exmo.align.impl.BasicAlignment
;
import
fr.inrialpes.exmo.align.impl.Annotations
;
import
java.util.Enumeration
;
import
java.util.Properties
;
import
java.util.Iterator
;
import
java.util.Set
;
import
java.util.HashSet
;
import
java.io.PrintWriter
;
import
java.net.URI
;
/**
* Evaluate proximity between two alignments.
* This function implements Precision/Recall/Fallout. The first alignment
* is thus the expected one.
*
* @author Jerome Euzenat
* @version $Id: PRecEvaluator.java 1425 2010-04-06 20:25:39Z euzenat $
*/
public
class
DiffEvaluator
extends
BasicEvaluator
implements
Evaluator
{
Set
<
Cell
>
truepositive
;
Set
<
Cell
>
falsenegative
;
Set
<
Cell
>
falsepositive
;
/** Creation
* Initiate Evaluator for precision and recall
* @param align1 : the reference alignment
* @param align2 : the alignment to evaluate
* The two parameters are transformed into URIAlignment before being processed
* Hence, if one of them is modified after initialisation, this will not be taken into account.
**/
public
DiffEvaluator
(
Alignment
align1
,
Alignment
align2
)
throws
AlignmentException
{
super
(((
BasicAlignment
)
align1
).
toURIAlignment
(),
((
BasicAlignment
)
align2
).
toURIAlignment
());
truepositive
=
new
HashSet
<
Cell
>();
falsenegative
=
new
HashSet
<
Cell
>();
falsepositive
=
new
HashSet
<
Cell
>();
}
public
void
init
(){
truepositive
=
new
HashSet
<
Cell
>();
falsenegative
=
new
HashSet
<
Cell
>();
falsepositive
=
new
HashSet
<
Cell
>();
}
public
void
diff
(){
// Cassia: Here you can put your code
}
public
double
eval
(
Properties
params
)
throws
AlignmentException
{
init
();
diff
();
return
1.0
;
}
public
double
eval
(
Properties
params
,
Object
cache
)
throws
AlignmentException
{
return
eval
(
params
);
}
public
String
HTMLString
(){
// Cassia: here you can put your display as a string and return it
String
result
=
""
;
result
+=
" <div xmlns:"
+
Namespace
.
ATLMAP
.
shortCut
+
"='"
+
Namespace
.
ATLMAP
.
prefix
+
"' typeof=\""
+
Namespace
.
ATLMAP
.
shortCut
+
":output\" href=''>"
;
result
+=
" <dl>"
;
result
+=
" </dl>\n </div>\n"
;
return
result
;
}
public
void
write
(
PrintWriter
writer
)
throws
java
.
io
.
IOException
{
// Cassia: here you can put your display as XML But this is not compulsory
writer
.
println
(
"<?xml version='1.0' encoding='utf-8' standalone='yes'?>"
);
}
public
Properties
getResults
()
{
Properties
results
=
new
Properties
();
results
.
setProperty
(
"true positive"
,
Integer
.
toString
(
truepositive
.
size
()
)
);
results
.
setProperty
(
"false negative"
,
Integer
.
toString
(
falsenegative
.
size
()
)
);
results
.
setProperty
(
"false positive"
,
Integer
.
toString
(
falsepositive
.
size
()
)
);
return
results
;
}
public
Set
<
Cell
>
getTruePositive
()
{
return
truepositive
;
}
public
Set
<
Cell
>
getFalseNegative
()
{
return
falsenegative
;
}
public
Set
<
Cell
>
getFalsePositive
()
{
return
falsepositive
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment