Mentions légales du service

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

- suppressed NaN when precision is 0.

parent 8a6fc79d
No related branches found
No related tags found
No related merge requests found
...@@ -149,9 +149,11 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator { ...@@ -149,9 +149,11 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator {
} }
protected double computeDerived() { protected double computeDerived() {
fmeasure = 2 * precision * recall / (precision + recall); if ( precision != 0. ) {
overall = recall * (2 - (1 / precision)); fmeasure = 2 * precision * recall / (precision + recall);
result = recall / precision; overall = recall * (2 - (1 / precision));
result = recall / precision;
} else { result = 0.; }
String timeExt = align2.getExtension( Namespace.ALIGNMENT.uri, Annotations.TIME ); String timeExt = align2.getExtension( Namespace.ALIGNMENT.uri, Annotations.TIME );
if ( timeExt != null ) time = Long.parseLong(timeExt); if ( timeExt != null ) time = Long.parseLong(timeExt);
//System.err.println(">>>> " + nbcorrect + " : " + nbfound + " : " + nbexpected); //System.err.println(">>>> " + nbcorrect + " : " + nbfound + " : " + nbexpected);
......
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