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
16b24366
Commit
16b24366
authored
12 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- added relation sensitivity to evaluators
parent
f4e9cd54
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
+7
-4
7 additions, 4 deletions
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
src/fr/inrialpes/exmo/align/impl/eval/WeightedPREvaluator.java
+7
-4
7 additions, 4 deletions
...r/inrialpes/exmo/align/impl/eval/WeightedPREvaluator.java
with
14 additions
and
8 deletions
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
+
7
−
4
View file @
16b24366
/*
* $Id$
*
* Copyright (C) INRIA, 2004-2011
* Copyright (C) INRIA, 2004-2011
, 2013
*
* 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
...
...
@@ -44,8 +44,7 @@ import java.net.URI;
* This function implements Precision/Recall. The first alignment
* is thus the expected one.
*
* NOTE: This measure does not take relations nor confidences into account
* For relation, this will wait for algebra based relations
* Basic relation sensitivity has been implemented
*
* @author Jerome Euzenat
* @version $Id$
...
...
@@ -61,6 +60,8 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
protected
double
fmeasure
=
0
.;
protected
boolean
relsensitive
=
false
;
protected
long
time
=
0
;
protected
int
nbexpected
=
0
;
...
...
@@ -109,6 +110,7 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
public
double
eval
(
Properties
params
)
throws
AlignmentException
{
init
();
nbfound
=
align2
.
nbCells
();
if
(
params
.
getProperty
(
"relations"
)
!=
null
)
relsensitive
=
true
;
for
(
Cell
c1
:
align1
)
{
URI
uri1
=
c1
.
getObject2AsURI
();
...
...
@@ -117,7 +119,8 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
if
(
s2
!=
null
){
for
(
Cell
c2
:
s2
)
{
URI
uri2
=
c2
.
getObject2AsURI
();
if
(
uri1
.
equals
(
uri2
)
)
{
if
(
uri1
.
equals
(
uri2
)
&&
(
!
relsensitive
||
c1
.
getRelation
().
equals
(
c2
.
getRelation
()
)
)
)
{
nbcorrect
++;
break
;
}
...
...
This diff is collapsed.
Click to expand it.
src/fr/inrialpes/exmo/align/impl/eval/WeightedPREvaluator.java
+
7
−
4
View file @
16b24366
/*
* $Id: WeightedPRecEvaluator.java 1494 2010-07-23 14:43:36Z euzenat $
*
* Copyright (C) INRIA, 2004-201
2
* Copyright (C) INRIA, 2004-201
3
*
* 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
...
...
@@ -44,8 +44,7 @@ import java.net.URI;
* This function implements Precision/Recall. The first alignment
* is thus the expected one.
*
* NOTE: This measure does not take relations nor confidences into account
* For relation, this will wait for algebra based relations
* Basic relation sensitivity has been implemented
*
* @author Jerome Euzenat
* @version $Id: PRecEvaluator.java 1494 2010-07-23 14:43:36Z euzenat $
...
...
@@ -61,6 +60,8 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator {
protected
double
fmeasure
=
0
.;
protected
boolean
relsensitive
=
false
;
protected
long
time
=
0
;
protected
double
nbexpected
=
0
.;
...
...
@@ -109,6 +110,7 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator {
public
double
eval
(
Properties
params
)
throws
AlignmentException
{
init
();
for
(
Cell
c2
:
align2
)
nbfound
+=
c2
.
getStrength
();
if
(
params
.
getProperty
(
"relations"
)
!=
null
)
relsensitive
=
true
;
for
(
Cell
c1
:
align1
)
{
URI
uri1
=
c1
.
getObject2AsURI
();
...
...
@@ -117,7 +119,8 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator {
if
(
s2
!=
null
){
for
(
Cell
c2
:
s2
)
{
URI
uri2
=
c2
.
getObject2AsURI
();
if
(
uri1
.
equals
(
uri2
)
)
{
if
(
uri1
.
equals
(
uri2
)
&&
(
!
relsensitive
||
c1
.
getRelation
().
equals
(
c2
.
getRelation
()
)
)
)
{
double
diff
=
c1
.
getStrength
()
-
c2
.
getStrength
();
nbcorrect
+=
1
.
-
((
diff
>
0
.)?
diff:
-
diff
);
break
;
...
...
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