-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from dice-group/dev/arjanoop/contingency_matr…
…ix_extension Contingency Matrix Extension for storing related macros
- Loading branch information
Showing
35 changed files
with
326 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ gerbil_data | |
google*.html | ||
export | ||
datadump.nt | ||
indexdbpedia_en_2014 | ||
indexdbpedia_en_2014 | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/main/java/org/aksw/gerbil/evaluate/AggregatedContingencyMetricsReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* Represents an aggregate report of evaluation results containing multiple extended contingency metrics. | ||
* This file is part of General Entity Annotator Benchmark. | ||
* | ||
* General Entity Annotator Benchmark 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 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* General Entity Annotator Benchmark 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 General Entity Annotator Benchmark. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.aksw.gerbil.evaluate; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Represents an aggregate report of evaluation results containing multiple extended contingency metrics. | ||
*/ | ||
public class AggregatedContingencyMetricsReport implements EvaluationResult{ | ||
|
||
/** The name of the evaluation result. */ | ||
private String name; | ||
|
||
/** The list of extended contingency metrics comprising the evaluation result. */ | ||
private List<ExtendedContingencyMetrics> value; | ||
|
||
/** | ||
* Constructs an instance of AggregatedContingencyMetricsReport with the given name. | ||
* | ||
* @param name The name of the evaluation result. | ||
*/ | ||
public AggregatedContingencyMetricsReport(String name) { | ||
this.name = name; | ||
this.value = new ArrayList<ExtendedContingencyMetrics>(); | ||
} | ||
|
||
/** | ||
* Constructs an instance of AggregatedContingencyMetricsReport with the given name and initial set of extended metrics. | ||
* | ||
* @param name The name of the evaluation result. | ||
* @param value An array of ExtendedContingencyMetrics representing the initial set of extended metrics. | ||
*/ | ||
public AggregatedContingencyMetricsReport(String name, ExtendedContingencyMetrics[] value) { | ||
this(name); | ||
this.addMetrics(value); | ||
} | ||
|
||
/** | ||
* Retrieves the name of the evaluation result. | ||
* @return The name of the evaluation result. | ||
*/ | ||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
/** | ||
* Retrieves the list of extended metrics comprising the evaluation result. | ||
* @return The list of extended metrics. | ||
*/ | ||
@Override | ||
public List<ExtendedContingencyMetrics> getValue() { | ||
return value; | ||
} | ||
|
||
/** | ||
* Adds one or more extended metrics to the evaluation result. | ||
* @param metrics One or more ExtendedContingencyMetrics objects to be added to the evaluation result. | ||
*/ | ||
public void addMetrics(ExtendedContingencyMetrics... metrics) { | ||
for(ExtendedContingencyMetrics metric : metrics){ | ||
this.value.add(metric); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
src/main/java/org/aksw/gerbil/evaluate/ExtendedContingencyMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/** | ||
* Represents extended evaluation metrics of an entity based on a contingency matrix. | ||
* This file is part of General Entity Annotator Benchmark. | ||
* | ||
* General Entity Annotator Benchmark 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 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* General Entity Annotator Benchmark 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 General Entity Annotator Benchmark. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.aksw.gerbil.evaluate; | ||
|
||
import org.aksw.gerbil.matching.EvaluationCounts; | ||
|
||
/** | ||
* Represents extended contingency metrics of an entity procured from experiment. | ||
*/ | ||
public class ExtendedContingencyMetrics { | ||
|
||
/** The identifier of the entity. */ | ||
private String id; | ||
|
||
/** Evaluation counts of Contingency Matrix for the entity. */ | ||
private EvaluationCounts count; | ||
|
||
/** The precision score of the entity. */ | ||
private double precision; | ||
|
||
/** The recall score of the entity. */ | ||
private double recall; | ||
|
||
/** The F1 score of the entity. */ | ||
private double f1Score; | ||
|
||
/** | ||
* Constructs an instance of ExtendedContingencyMetrics. | ||
* | ||
* @param id The identifier of the entity. | ||
* @param count Evaluation counts for the entity. | ||
* @param precision The precision score of the entity. | ||
* @param recall The recall score of the entity. | ||
* @param f1Score The F1 score of the entity. | ||
*/ | ||
public ExtendedContingencyMetrics(String id, EvaluationCounts count, double precision, double recall, double f1Score) { | ||
this.id = id; | ||
this.count = count; | ||
this.precision = precision; | ||
this.recall = recall; | ||
this.f1Score = f1Score; | ||
} | ||
|
||
/** | ||
* Retrieves the identifier of the entity. | ||
* @return The identifier of the entity. | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* Retrieves the evaluation counts for the entity. | ||
* @return Evaluation counts for the entity. | ||
*/ | ||
public EvaluationCounts getCount() { | ||
return count; | ||
} | ||
|
||
/** | ||
* Retrieves the precision score of the entity. | ||
* @return The precision score of the entity. | ||
*/ | ||
public double getPrecision() { | ||
return precision; | ||
} | ||
|
||
/** | ||
* Retrieves the recall score of the entity. | ||
* @return The recall score of the entity. | ||
*/ | ||
public double getRecall() { | ||
return recall; | ||
} | ||
|
||
/** | ||
* Retrieves the F1 score of the entity. | ||
* @return The F1 score of the entity. | ||
*/ | ||
public double getF1Score() { | ||
return f1Score; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.