ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1593376 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
Date Thu, 08 May 2014 18:53:04 GMT
Author: clin
Date: Thu May  8 18:53:04 2014
New Revision: 1593376

URL: http://svn.apache.org/r1593376
Log:
add text span, and correct system predictions to the output file of event properties

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java?rev=1593376&r1=1593375&r2=1593376&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
Thu May  8 18:53:04 2014
@@ -212,12 +212,12 @@ Evaluation_ImplBase<Map<String, Annotati
 						for (int i = 0; i < goldEvents.size(); ++i) {
 							String goldOutcome = getProperty.apply(goldEvents.get(i));
 							String systemOutcome = getProperty.apply(systemEvents.get(i));
+							EventMention event = goldEvents.get(i);
+							int begin = event.getBegin();
+							int end = event.getEnd();
+							int windowBegin = Math.max(0, begin - 50);
+							int windowEnd = Math.min(text.length(), end + 50);
 							if (!goldOutcome.equals(systemOutcome)) {
-								EventMention event = goldEvents.get(i);
-								int begin = event.getBegin();
-								int end = event.getEnd();
-								int windowBegin = Math.max(0, begin - 50);
-								int windowEnd = Math.min(text.length(), end + 50);
 								this.loggers.get(name).fine(String.format(
 										"%s was %s but should be %s, in  ...%s[!%s!:%d-%d]%s...",
 										name,
@@ -228,6 +228,16 @@ Evaluation_ImplBase<Map<String, Annotati
 										begin,
 										end,
 										text.substring(end, windowEnd).replaceAll("[\r\n]", " ")));
+							}else{//if gold outcome equals system outcome
+								this.loggers.get(name).fine(String.format(
+										"%s was correctly labeled as %s, in  ...%s[!%s!:%d-%d]%s...",
+										name,
+										goldOutcome,
+										text.substring(windowBegin, begin).replaceAll("[\r\n]", " "),
+										text.substring(begin, end),
+										begin,
+										end,
+										text.substring(end, windowEnd).replaceAll("[\r\n]", " ")));
 							}
 						}
 					}



Mime
View raw message