ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1641500 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/ eval/
Date Mon, 24 Nov 2014 22:39:49 GMT
Author: tmill
Date: Mon Nov 24 22:39:48 2014
New Revision: 1641500

URL: http://svn.apache.org/r1641500
Log:
CTAKES-82: Fix ctakes-temporal to read official data format for THYME release/clinical tempeval.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEAnaforaXMLReader.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKRelations.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventCoreference.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfI2B2TemporalRelations.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfMetaTimeExpressionExtractor.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfNEPredicateEventSpans.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfSelfEventTimeRelations.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations_ImplBase.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/THYMEData.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEAnaforaXMLReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEAnaforaXMLReader.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEAnaforaXMLReader.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEAnaforaXMLReader.java
Mon Nov 24 22:39:48 2014
@@ -79,15 +79,15 @@ public class THYMEAnaforaXMLReader exten
       description = "list of suffixes that might be added to a file name to identify the
Anafora "
           + "XML annotations file; only the first suffix corresponding to a file will be
used")
   private String[] anaforaXMLSuffixes = new String[] {
-      ".Gold_Temporal_Entities.xml",
-      ".Gold_Temporal_Relations.xml",
+      ".Temporal-Relations.gold.completed.xml",
+      ".Temporal-Relation.gold.completed.xml",
+      ".Temporal-Relation-Adjudication.gold.completed.xml",
+      ".Temporal-Entity-Adjudication.gold.completed.xml",
       ".temporal.Temporal-Adjudication.gold.completed.xml",
       ".temporal.Temporal-Entities.gold.completed.xml",
       ".Temporal-Entity.gold.completed.xml",
-      ".Temporal-Relation-Adjudication.gold.completed.xml",
-      ".Temporal-Entity-Adjudication.gold.completed.xml",
-      ".Temporal-Relation.gold.completed.xml",
-      ".Temporal-Relations.gold.completed.xml"};
+      ".Gold_Temporal_Entities.xml",
+      ".Gold_Temporal_Relations.xml"};
 
   public static AnalysisEngineDescription getDescription() throws ResourceInitializationException
{
     return AnalysisEngineFactory.createEngineDescription(THYMEAnaforaXMLReader.class);
@@ -108,14 +108,13 @@ public class THYMEAnaforaXMLReader exten
     LOGGER.info("processing " + textFile);
 
     // determine possible Anafora XML file names
+    File corefFile = new File(textFile.getPath() + ".Coreference.gold.completed.xml");
     List<File> possibleXMLFiles = Lists.newArrayList();
-    possibleXMLFiles.add(new File(this.anaforaDirectory, textFile.getName() + ".Coreference.gold.completed.xml"));
     for (String anaforaXMLSuffix : this.anaforaXMLSuffixes) {
       if (this.anaforaDirectory == null) {
         possibleXMLFiles.add(new File(textFile + anaforaXMLSuffix));
       } else {
-        File subDir = new File(this.anaforaDirectory, textFile.getName());
-        possibleXMLFiles.add(new File(subDir, textFile.getName() + anaforaXMLSuffix));
+        possibleXMLFiles.add(new File(textFile.getPath() + anaforaXMLSuffix));
       }
     }
 
@@ -131,6 +130,13 @@ public class THYMEAnaforaXMLReader exten
       throw new IllegalArgumentException("no Anafora XML file found from " + possibleXMLFiles);
     }
 
+    processXmlFile(jCas, xmlFile);
+    if(corefFile.exists()){
+    	processXmlFile(jCas, corefFile);
+    }
+  }
+  
+  private static void processXmlFile(JCas jCas, File xmlFile) throws AnalysisEngineProcessException{
     // load the XML
     Element dataElem;
     try {

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfAnnotationSpans_ImplBase.java
Mon Nov 24 22:39:48 2014
@@ -79,9 +79,8 @@ Evaluation_ImplBase<AnnotationStatistics
 			XMLFormat xmlFormat,
 			File xmiDirectory,
 			File treebankDirectory,
-			File coreferenceDirectory,
 			Class<? extends Annotation> annotationClass) {
-		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, treebankDirectory,
coreferenceDirectory);
+		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, treebankDirectory);
 		this.annotationClass = annotationClass;
 	}
 
@@ -92,7 +91,7 @@ Evaluation_ImplBase<AnnotationStatistics
 			XMLFormat xmlFormat,
 			File xmiDirectory,
 			Class<? extends Annotation> annotationClass) {
-		this(baseDirectory,rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, null, null,
annotationClass);
+		this(baseDirectory,rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, null, annotationClass);
 	}
 
 	protected abstract AnalysisEngineDescription getDataWriterDescription(File directory)

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKRelations.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfClearTKRelations.java
Mon Nov 24 22:39:48 2014
@@ -105,7 +105,7 @@ public class EvaluationOfClearTKRelation
       File xmlDirectory,
       org.apache.ctakes.temporal.eval.Evaluation_ImplBase.XMLFormat xmlFormat,
       File xmiDirectory) {
-    super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, null, null,
false, false, defaultParams);
+    super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, null, false,
false, defaultParams);
   }
   
   private void setExtractEventTime(boolean eventTime) {

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventCoreference.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventCoreference.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventCoreference.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventCoreference.java
Mon Nov 24 22:39:48 2014
@@ -106,7 +106,6 @@ public class EvaluationOfEventCoreferenc
         options.getXMLFormat(),
         options.getXMIDirectory(),
         options.getTreebankDirectory(),
-        options.getCoreferenceDirectory(),
         options.getPrintErrors(),
         options.getPrintFormattedRelations(),
         params,
@@ -129,10 +128,10 @@ public class EvaluationOfEventCoreferenc
   public EvaluationOfEventCoreference(File baseDirectory,
       File rawTextDirectory, File xmlDirectory,
       org.apache.ctakes.temporal.eval.Evaluation_ImplBase.XMLFormat xmlFormat,
-      File xmiDirectory, File treebankDirectory, File coreferenceDirectory, boolean printErrors,
+      File xmiDirectory, File treebankDirectory, boolean printErrors,
       boolean printRelations, ParameterSettings params, String cmdParams, String outputDirectory)
{
     super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory,
-        treebankDirectory, coreferenceDirectory, printErrors, printRelations, params);
+        treebankDirectory, printErrors, printRelations, params);
     this.outputDirectory = outputDirectory;
     this.kernelParams = cmdParams == null ? null : cmdParams.split(" ");
   }

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
Mon Nov 24 22:39:48 2014
@@ -166,7 +166,6 @@ EvaluationOfTemporalRelations_ImplBase{
 					options.getXMLFormat(),
 					options.getXMIDirectory(),
 					options.getTreebankDirectory(),
-					options.getCoreferenceDirectory(),
 					options.getClosure(),
 					options.getPrintErrors(),
 					options.getPrintFormattedRelations(),
@@ -238,7 +237,6 @@ EvaluationOfTemporalRelations_ImplBase{
 			XMLFormat xmlFormat,
 			File xmiDirectory,
 			File treebankDirectory,
-			File coreferenceDirectory,
 			boolean useClosure,
 			boolean printErrors,
 			boolean printRelations,
@@ -253,7 +251,6 @@ EvaluationOfTemporalRelations_ImplBase{
 				xmlFormat,
 				xmiDirectory,
 				treebankDirectory,
-				coreferenceDirectory,
 				printErrors,
 				printRelations,
 				params);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfI2B2TemporalRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfI2B2TemporalRelations.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfI2B2TemporalRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfI2B2TemporalRelations.java
Mon Nov 24 22:39:48 2014
@@ -242,7 +242,6 @@ EvaluationOfTemporalRelations_ImplBase{
 				xmlFormat,
 				xmiDirectory,
 				treebankDirectory,
-				null,
 				printErrors,
 				printRelations,
 				params);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfMetaTimeExpressionExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfMetaTimeExpressionExtractor.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfMetaTimeExpressionExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfMetaTimeExpressionExtractor.java
Mon Nov 24 22:39:48 2014
@@ -66,7 +66,7 @@ public class EvaluationOfMetaTimeExpress
       File xmiDirectory, File treebankDirectory,
       List<Integer> allTrain, Class<? extends Annotation> annotationClass) {
     super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory,
-        treebankDirectory, null, annotationClass);
+        treebankDirectory, annotationClass);
     this.allTrain = allTrain;
   }
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfNEPredicateEventSpans.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfNEPredicateEventSpans.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfNEPredicateEventSpans.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfNEPredicateEventSpans.java
Mon Nov 24 22:39:48 2014
@@ -44,7 +44,7 @@ public class EvaluationOfNEPredicateEven
 			File xmiDirectory, File treebankDirectory,
 			Class<? extends Annotation> annotationClass) {
 		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat,
-				xmiDirectory, treebankDirectory, null, annotationClass);
+				xmiDirectory, treebankDirectory, annotationClass);
 		// TODO Auto-generated constructor stub
 	}
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfSelfEventTimeRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfSelfEventTimeRelations.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfSelfEventTimeRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfSelfEventTimeRelations.java
Mon Nov 24 22:39:48 2014
@@ -167,7 +167,6 @@ EvaluationOfTemporalRelations_ImplBase{
 					options.getXMLFormat(),
 					options.getXMIDirectory(),
 					options.getTreebankDirectory(),
-					options.getCoreferenceDirectory(),
 					options.getClosure(),
 					options.getPrintErrors(),
 					options.getPrintFormattedRelations(),
@@ -245,7 +244,6 @@ EvaluationOfTemporalRelations_ImplBase{
 			XMLFormat xmlFormat,
 			File xmiDirectory,
 			File treebankDirectory,
-			File coreferenceDirectory,
 			boolean useClosure,
 			boolean printErrors,
 			boolean printRelations,
@@ -260,7 +258,6 @@ EvaluationOfTemporalRelations_ImplBase{
 				xmlFormat,
 				xmiDirectory,
 				treebankDirectory,
-				coreferenceDirectory,
 				printErrors,
 				printRelations,
 				params);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations_ImplBase.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations_ImplBase.java
Mon Nov 24 22:39:48 2014
@@ -81,16 +81,6 @@ Evaluation_ImplBase<AnnotationStatistics
 
 	public EvaluationOfTemporalRelations_ImplBase(File baseDirectory,
 			File rawTextDirectory, File xmlDirectory, XMLFormat xmlFormat,
-			File xmiDirectory, File treebankDirectory, File coreferenceDirectory, boolean printErrors,
boolean printRelations, ParameterSettings params) {
-		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory,
-				treebankDirectory, coreferenceDirectory);
-		this.params = params;
-		this.printRelations = printRelations;
-		this.printErrors =  printErrors;
-	}
-
-	public EvaluationOfTemporalRelations_ImplBase(File baseDirectory,
-			File rawTextDirectory, File xmlDirectory, XMLFormat xmlFormat,
 			File xmiDirectory, File treebankDirectory, boolean printErrors, boolean printRelations,
ParameterSettings params) {
 		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory,
 				treebankDirectory);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTimeSpans.java
Mon Nov 24 22:39:48 2014
@@ -201,7 +201,7 @@ public class EvaluationOfTimeSpans exten
 			Class<? extends JCasAnnotator_ImplBase> annotatorClass,
 					boolean printOverlapping,
 					String[] trainingArguments) {
-		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, treebankDirectory,
null, TimeMention.class);
+		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, treebankDirectory,
TimeMention.class);
 		this.annotatorClass = annotatorClass;
 		this.featureSelectionThreshold = featureSelectionThreshold;
 		this.trainingArguments = trainingArguments;

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=1641500&r1=1641499&r2=1641500&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
Mon Nov 24 22:39:48 2014
@@ -56,6 +56,7 @@ import org.apache.ctakes.core.resource.F
 import org.apache.ctakes.core.resource.FileResourceImpl;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
+import org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator;
 import org.apache.ctakes.dictionary.lookup2.ae.AbstractJCasTermAnnotator;
 import org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator;
 import org.apache.ctakes.dictionary.lookup2.ae.JCasTermAnnotator;
@@ -149,15 +150,12 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 		@Option(longName = "dev-remainders", defaultValue = "3")
 		public CommandLine.IntegerRanges getDevRemainders();
 
-		@Option(longName = "test-remainders", defaultValue = "6-7")
+		@Option(longName = "test-remainders", defaultValue = "4-5")
 		public CommandLine.IntegerRanges getTestRemainders();
 
 		@Option(longName = "treebank", defaultToNull=true)
 		public File getTreebankDirectory();
 
-		@Option(longName = "coreference", defaultToNull=true)
-		public File getCoreferenceDirectory();
-
 		@Option
 		public boolean getUseGoldTrees();
 
@@ -212,8 +210,6 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 
 	protected File treebankDirectory;
 
-	protected File coreferenceDirectory;
-
 	protected boolean printErrors = false;
 
 	protected boolean printOverlapping = false;
@@ -228,8 +224,7 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 			File xmlDirectory,
 			XMLFormat xmlFormat,
 			File xmiDirectory,
-			File treebankDirectory,
-			File coreferenceDirectory) {
+			File treebankDirectory) {
 		super(baseDirectory);
 		this.rawTextDirectory = rawTextDirectory;
 		this.xmlDirectory = xmlDirectory;
@@ -237,18 +232,6 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 		this.xmiDirectory = xmiDirectory;
 		this.xmiExists = this.xmiDirectory.exists() && this.xmiDirectory.listFiles().length
> 0;
 		this.treebankDirectory = treebankDirectory;
-		this.coreferenceDirectory = coreferenceDirectory;
-	}
-
-	public Evaluation_ImplBase(
-			File baseDirectory,
-			File rawTextDirectory,
-			File xmlDirectory,
-			XMLFormat xmlFormat,
-			File xmiDirectory,
-			File treebankDirectory) {
-		this(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat,
-				xmiDirectory, treebankDirectory, null);
 	}
 
 	public void setI2B2Output(String outDir){
@@ -273,23 +256,23 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 
 	private List<File> getFilesFor(List<Integer> patientSets) throws FileNotFoundException
{
 		List<File> files = new ArrayList<>();
-		if (this.rawTextDirectory == null
-				&& this.xmlFormat == XMLFormat.Anafora) {
-			for (File dir : this.xmlDirectory.listFiles()) {
-				Set<String> ids = new HashSet<>();
-				for (Integer set : patientSets) {
-					ids.add(String.format("ID%03d", set));
-				}
-				if (dir.isDirectory()) {
-					if (ids.contains(dir.getName().substring(0, 5))) {
-						File file = new File(dir, dir.getName());
-						if (file.exists()) {
-							files.add(file);
-						} else {
-							LOGGER.warn("Missing note: " + file);
+		if (this.xmlFormat == XMLFormat.Anafora) {
+			Set<String> ids = new HashSet<>();
+			for (Integer set : patientSets) {
+				ids.add(String.format("ID%03d", set));
+			}
+			for (String section : THYMEData.SECTIONS){
+				File xmlSubdir = new File(this.xmlDirectory, section);
+				for (File dir : xmlSubdir.listFiles()) {
+					if (dir.isDirectory()) {
+						if (ids.contains(dir.getName().substring(0, 5))) {
+							File file = new File(dir, dir.getName());
+							if (file.exists()) {
+								files.add(file);
+							} else {
+								LOGGER.warn("Missing note: " + file);
+							}
 						}
-					} else {
-						LOGGER.info("Skipping note: " + dir);
 					}
 				}
 			}
@@ -317,7 +300,8 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 				}
 				assert !(train.exists() && test.exists());
 			}
-		}	else  {
+		}	else if( xmlFormat == XMLFormat.Knowtator) {
+			LOGGER.warn("This is an old annotation format -- please upgrade to using anafora files.");
 			for (Integer set : patientSets) {
 				final int setNum = set;
 				for (File file : rawTextDirectory.listFiles(new FilenameFilter(){
@@ -327,30 +311,12 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 					}})) {
 					// skip hidden files like .svn
 					if (!file.isHidden()) {
-						if(xmlFormat == XMLFormat.Knowtator){
-							files.add(file);
-						}else{
-							// look for equivalent in xml directory:
-							File xmlFile = new File(xmlDirectory, file.getName());
-							if(xmlFile.exists()){
-								if(coreferenceDirectory != null){
-									// verify that coref version of xml exists
-									File corefFile = new File(coreferenceDirectory, file.getName()+".Coreference.gold.completed.xml");
-									if(corefFile.exists() && xmlFile.exists()){
-										files.add(file);
-									}else{
-										System.err.println("Missing coref patient file : " + corefFile);
-									}
-								}else{
-									files.add(file);
-								}
-							}else{
-								System.err.println("Missing patient file : " + xmlFile);
-							}
-						}
+						files.add(file);
 					} 
 				}
 			}
+		} else {
+			LOGGER.error("Unknown data format -- please specify Anafora, i2b2, or Knowtator format.");
 		}
 		return files;
 	}
@@ -413,13 +379,6 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 			break;
 		}
 
-		if(this.coreferenceDirectory != null){
-			aggregateBuilder.add(
-					THYMEAnaforaXMLReader.getDescription(this.coreferenceDirectory),
-					CAS.NAME_DEFAULT_SOFA,
-					GOLD_VIEW_NAME);
-		}
-
 		// identify segments
 		aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(SegmentsFromBracketedSectionTagsAnnotator.class));
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/THYMEData.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/THYMEData.java?rev=1641500&r1=1641499&r2=1641500&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/THYMEData.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/THYMEData.java
Mon Nov 24 22:39:48 2014
@@ -34,6 +34,8 @@ public class THYMEData {
 	public static final Set<Integer> DEV_REMAINDERS = Sets.newHashSet(4, 5);
 	public static final Set<Integer> TEST_REMAINDERS = Sets.newHashSet(6, 7); 
 
+	public static final String[] SECTIONS = new String[] {"Train", "Dev", "Test"};
+	
 	public static List<Integer> getPatientSets(List<Integer> patientSets, Collection<Integer>
remainders) {
 		List<Integer> items = new ArrayList<>();
 		for (Integer i : patientSets) {
@@ -69,6 +71,7 @@ public class THYMEData {
 		return getPatientSets(patientSets, TEST_REMAINDERS);
 	}
 
+
 	public static List<File> getFilesFor(List<Integer> patientSets, File rawTextDirectory)
{
 		if ( !rawTextDirectory.exists() ) {
 			return Collections.emptyList();



Mime
View raw message