ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevenbeth...@apache.org
Subject svn commit: r1480986 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/EventAnnotator.java eval/Evaluation_ImplBase.java
Date Fri, 10 May 2013 12:00:20 GMT
Author: stevenbethard
Date: Fri May 10 12:00:20 2013
New Revision: 1480986

URL: http://svn.apache.org/r1480986
Log:
Makes CopyFromGold only remove exact class matches. So, for example, copying EventMentions
from gold will only remove any existing EventMentions, not subclasses like ProcedureMention.
Fixes EventAnnotator accordingly to account for this change.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java?rev=1480986&r1=1480985&r2=1480986&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Fri May 10 12:00:20 2013
@@ -214,7 +214,12 @@ public class EventAnnotator extends Temp
       // during training, the list of all outcomes for the tokens
       List<String> outcomes;
       if (this.isTraining()) {
-        List<EventMention> events = JCasUtil.selectCovered(jCas, EventMention.class,
sentence);
+        List<EventMention> events = Lists.newArrayList();
+        for (EventMention event : JCasUtil.selectCovered(jCas, EventMention.class, sentence))
{
+          if (event.getClass().equals(EventMention.class)) {
+            events.add(event);
+          }
+        }
         outcomes = this.eventChunking.createOutcomes(jCas, tokens, events);
       }
       // during prediction, the list of outcomes predicted so far

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1480986&r1=1480985&r2=1480986&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Fri May 10 12:00:20 2013
@@ -617,7 +617,9 @@ public abstract class Evaluation_ImplBas
       }
       for (Class<? extends TOP> annotationClass : this.annotationClasses) {
         for (TOP annotation : Lists.newArrayList(JCasUtil.select(systemView, annotationClass)))
{
-          annotation.removeFromIndexes();
+          if (annotation.getClass().equals(annotationClass)) {
+            annotation.removeFromIndexes();
+          }
         }
       }
       CasCopier copier = new CasCopier(goldView.getCas(), systemView.getCas());



Mime
View raw message