incubator-ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevenbeth...@apache.org
Subject svn commit: r1424219 - /incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
Date Wed, 19 Dec 2012 23:17:41 GMT
Author: stevenbethard
Date: Wed Dec 19 23:17:41 2012
New Revision: 1424219

URL: http://svn.apache.org/viewvc?rev=1424219&view=rev
Log:
Adds workaround for invalid annotations from Knowtator.

Modified:
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java?rev=1424219&r1=1424218&r2=1424219&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
Wed Dec 19 23:17:41 2012
@@ -119,7 +119,15 @@ public abstract class EvaluationOfAnnota
       stats.add(goldAnnotations, systemAnnotations);
 
       Set<Annotation> goldSet = new TreeSet<Annotation>(bySpans);
-      goldSet.addAll(goldAnnotations);
+      for (Annotation goldAnnotation : goldAnnotations) {
+        // TODO: fix data so that this is not necessary
+        if (goldAnnotation.getBegin() == Integer.MAX_VALUE || goldAnnotation.getEnd() ==
Integer.MIN_VALUE) {
+          this.logger.warning("Invalid annotation");
+          continue;
+        }
+        goldSet.add(goldAnnotation);
+      }
+      //goldSet.addAll(goldAnnotations);
       Set<Annotation> systemSet = new TreeSet<Annotation>(bySpans);
       systemSet.addAll(systemAnnotations);
 



Mime
View raw message