ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1553132 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventProperties.java
Date Mon, 23 Dec 2013 15:50:40 GMT
Author: clin
Date: Mon Dec 23 15:50:39 2013
New Revision: 1553132

URL: http://svn.apache.org/r1553132
Log:
add "test" option and split data between training and testing set for ClearTk DocTimeRel evaluation
code

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventProperties.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventProperties.java?rev=1553132&r1=1553131&r2=1553132&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventProperties.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventProperties.java
Mon Dec 23 15:50:39 2013
@@ -20,6 +20,7 @@ package org.apache.ctakes.temporal.eval;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -76,6 +77,17 @@ public class EvaluationOfClearTKEventPro
     List<Integer> patientSets = options.getPatients().getList();
     List<Integer> trainItems = THYMEData.getTrainPatientSets(patientSets);
     List<Integer> devItems = THYMEData.getDevPatientSets(patientSets);
+    List<Integer> testItems = THYMEData.getTestPatientSets(patientSets);
+    
+    List<Integer> allTraining = new ArrayList<Integer>(trainItems);
+    List<Integer> allTest = null;
+    if(options.getTest()){
+      allTraining.addAll(devItems);
+      allTest = new ArrayList<Integer>(testItems);
+    }else{
+      allTest = new ArrayList<Integer>(devItems);
+    }
+    
     EvaluationOfClearTKEventProperties evaluation = new EvaluationOfClearTKEventProperties(
         new File("target/eval/event-properties"),
         options.getRawTextDirectory(),
@@ -84,7 +96,7 @@ public class EvaluationOfClearTKEventPro
         options.getXMIDirectory());
     evaluation.prepareXMIsFor(patientSets);
     evaluation.logClassificationErrors(new File("target/eval"), "ctakes-event-property-errors");
-    Map<String, AnnotationStatistics<String>> stats = evaluation.trainAndTest(trainItems,
devItems);
+    Map<String, AnnotationStatistics<String>> stats = evaluation.trainAndTest(allTraining,
allTest);
     for (String name : PROPERTY_NAMES) {
       System.err.println("====================");
       System.err.println(name);



Mime
View raw message