incubator-ctakes-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1424221&view=rev
Log:
Moves patientSets out of Evaluation_ImplBase to make it easier to do train/dev/test experiments.

Modified:
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventSpans.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKTimeSpans.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_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=1424221&r1=1424220&r2=1424221&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:30:27 2012
@@ -70,9 +70,8 @@ public abstract class EvaluationOfAnnota
       File baseDirectory,
       File rawTextDirectory,
       File knowtatorXMLDirectory,
-      List<Integer> patientSets,
       Set<AnnotatorType> annotatorFlags) {
-    super(baseDirectory, rawTextDirectory, knowtatorXMLDirectory, patientSets, annotatorFlags);
+    super(baseDirectory, rawTextDirectory, knowtatorXMLDirectory, annotatorFlags);
   }
 
   protected abstract AnalysisEngineDescription getDataWriterDescription(File directory)

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventSpans.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventSpans.java?rev=1424221&r1=1424220&r2=1424221&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventSpans.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKEventSpans.java
Wed Dec 19 23:30:27 2012
@@ -51,10 +51,11 @@ public class EvaluationOfClearTKEventSpa
     EvaluationOfClearTKEventSpans evaluation = new EvaluationOfClearTKEventSpans(
         new File("target/eval"),
         options.getRawTextDirectory(),
-        options.getKnowtatorXMLDirectory(),
-        options.getPatients().getList());
+        options.getKnowtatorXMLDirectory());
     evaluation.setLogging(Level.FINE, new File("target/eval/cleartk-event-errors.log"));
-    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(4);
+    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(
+        options.getPatients().getList(),
+        4);
     for (AnnotationStatistics<String> stats : foldStats) {
       System.err.println(stats);
     }
@@ -65,13 +66,11 @@ public class EvaluationOfClearTKEventSpa
   public EvaluationOfClearTKEventSpans(
       File baseDirectory,
       File rawTextDirectory,
-      File knowtatorXMLDirectory,
-      List<Integer> patientSets) {
+      File knowtatorXMLDirectory) {
     super(
         baseDirectory,
         rawTextDirectory,
         knowtatorXMLDirectory,
-        patientSets,
         EnumSet.noneOf(AnnotatorType.class));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKTimeSpans.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKTimeSpans.java?rev=1424221&r1=1424220&r2=1424221&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKTimeSpans.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKTimeSpans.java
Wed Dec 19 23:30:27 2012
@@ -50,10 +50,11 @@ public class EvaluationOfClearTKTimeSpan
     EvaluationOfClearTKTimeSpans evaluation = new EvaluationOfClearTKTimeSpans(
         new File("target/eval"),
         options.getRawTextDirectory(),
-        options.getKnowtatorXMLDirectory(),
-        options.getPatients().getList());
+        options.getKnowtatorXMLDirectory());
     evaluation.setLogging(Level.FINE, new File("target/eval/cleartk-time-errors.log"));
-    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(4);
+    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(
+        options.getPatients().getList(),
+        4);
     for (AnnotationStatistics<String> stats : foldStats) {
       System.err.println(stats);
     }
@@ -64,13 +65,11 @@ public class EvaluationOfClearTKTimeSpan
   public EvaluationOfClearTKTimeSpans(
       File baseDirectory,
       File rawTextDirectory,
-      File knowtatorXMLDirectory,
-      List<Integer> patientSets) {
+      File knowtatorXMLDirectory) {
     super(
         baseDirectory,
         rawTextDirectory,
         knowtatorXMLDirectory,
-        patientSets,
         EnumSet.noneOf(AnnotatorType.class));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java?rev=1424221&r1=1424220&r2=1424221&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
Wed Dec 19 23:30:27 2012
@@ -60,9 +60,9 @@ public class EvaluationOfEventProperties
     EvaluationOfEventProperties evaluation = new EvaluationOfEventProperties(
         new File("target/eval"),
         options.getRawTextDirectory(),
-        options.getKnowtatorXMLDirectory(),
-        options.getPatients().getList());
-    List<Map<String, AnnotationStatistics<String>>> foldStats = evaluation.crossValidation(4);
+        options.getKnowtatorXMLDirectory());
+    List<Map<String, AnnotationStatistics<String>>> foldStats = evaluation.crossValidation(
+        options.getPatients().getList(), 4);
     Map<String, AnnotationStatistics<String>> overallStats = new HashMap<String,
AnnotationStatistics<String>>();
     for (String name : PROPERTY_NAMES) {
       overallStats.put(name, new AnnotationStatistics<String>());
@@ -89,13 +89,11 @@ public class EvaluationOfEventProperties
   public EvaluationOfEventProperties(
       File baseDirectory,
       File rawTextDirectory,
-      File knowtatorXMLDirectory,
-      List<Integer> patientSets) {
+      File knowtatorXMLDirectory) {
     super(
         baseDirectory,
         rawTextDirectory,
         knowtatorXMLDirectory,
-        patientSets,
         EnumSet.of(AnnotatorType.PART_OF_SPEECH_TAGS));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java?rev=1424221&r1=1424220&r2=1424221&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventSpans.java
Wed Dec 19 23:30:27 2012
@@ -65,11 +65,12 @@ public class EvaluationOfEventSpans exte
         new File("target/eval"),
         options.getRawTextDirectory(),
         options.getKnowtatorXMLDirectory(),
-        options.getPatients().getList(),
         options.getProbabilityOfKeepingANegativeExample(),
         options.getFeatureSelectionThreshold());
     evaluation.setLogging(Level.FINE, new File("target/eval/ctakes-event-errors.log"));
-    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(2);
+    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(
+        options.getPatients().getList(),
+        2);
     for (AnnotationStatistics<String> stats : foldStats) {
       System.err.println(stats);
     }
@@ -85,10 +86,9 @@ public class EvaluationOfEventSpans exte
       File baseDirectory,
       File rawTextDirectory,
       File knowtatorXMLDirectory,
-      List<Integer> patientSets,
       float probabilityOfKeepingANegativeExample,
       float featureSelectionThreshold) {
-    super(baseDirectory, rawTextDirectory, knowtatorXMLDirectory, patientSets, EnumSet.of(
+    super(baseDirectory, rawTextDirectory, knowtatorXMLDirectory, EnumSet.of(
         AnnotatorType.PART_OF_SPEECH_TAGS));
         //AnnotatorType.UMLS_NAMED_ENTITIES,
         //AnnotatorType.LEXICAL_VARIANTS,

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java?rev=1424221&r1=1424220&r2=1424221&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
Wed Dec 19 23:30:27 2012
@@ -44,10 +44,11 @@ public class EvaluationOfTimeSpans exten
     EvaluationOfTimeSpans evaluation = new EvaluationOfTimeSpans(
         new File("target/eval"),
         options.getRawTextDirectory(),
-        options.getKnowtatorXMLDirectory(),
-        options.getPatients().getList());
+        options.getKnowtatorXMLDirectory());
     evaluation.setLogging(Level.FINE, new File("target/eval/ctakes-time-errors.log"));
-    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(4);
+    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(
+        options.getPatients().getList(),
+        4);
     for (AnnotationStatistics<String> stats : foldStats) {
       System.err.println(stats);
     }
@@ -58,13 +59,11 @@ public class EvaluationOfTimeSpans exten
   public EvaluationOfTimeSpans(
       File baseDirectory,
       File rawTextDirectory,
-      File knowtatorXMLDirectory,
-      List<Integer> patientSets) {
+      File knowtatorXMLDirectory) {
     super(
         baseDirectory,
         rawTextDirectory,
         knowtatorXMLDirectory,
-        patientSets,
         EnumSet.of(AnnotatorType.PART_OF_SPEECH_TAGS));
   }
 

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1424221&r1=1424220&r2=1424221&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Wed Dec 19 23:30:27 2012
@@ -90,31 +90,23 @@ public abstract class Evaluation_ImplBas
 
   protected File knowtatorXMLDirectory;
 
-  protected List<Integer> patientSets;
-
   private Set<AnnotatorType> annotatorFlags;
 
   public Evaluation_ImplBase(
       File baseDirectory,
       File rawTextDirectory,
       File knowtatorXMLDirectory,
-      List<Integer> patientSets,
       Set<AnnotatorType> annotatorFlags) {
     super(baseDirectory);
     this.rawTextDirectory = rawTextDirectory;
     this.knowtatorXMLDirectory = knowtatorXMLDirectory;
-    this.patientSets = patientSets;
     this.annotatorFlags = annotatorFlags;
   }
 
-  public List<STATISTICS_TYPE> crossValidation(int nFolds) throws Exception {
-    return this.crossValidation(this.patientSets, nFolds);
-  }
-
   @Override
-  protected CollectionReader getCollectionReader(List<Integer> selectedPatientSets)
throws Exception {
+  protected CollectionReader getCollectionReader(List<Integer> patientSets) throws
Exception {
     List<File> files = new ArrayList<File>();
-    for (Integer set : selectedPatientSets) {
+    for (Integer set : patientSets) {
       File setTextDirectory = new File(this.rawTextDirectory, "doc" + set);
       for (File file : setTextDirectory.listFiles()) {
         files.add(file);



Mime
View raw message