ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1611031 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/ eval/
Date Wed, 16 Jul 2014 14:46:38 GMT
Author: tmill
Date: Wed Jul 16 14:46:37 2014
New Revision: 1611031

URL: http://svn.apache.org/r1611031
Log:
CTAKES-199: Multiple changes to temporal structure to allow for coreference data.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventCoreferenceAnnotator.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/EvaluationOfTemporalRelations.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/Evaluation_ImplBase.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventCoreferenceAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventCoreferenceAnnotator.java?rev=1611031&r1=1611030&r2=1611031&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventCoreferenceAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventCoreferenceAnnotator.java
Wed Jul 16 14:46:37 2014
@@ -8,13 +8,13 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
-import org.apache.ctakes.coreference.ae.features.DistSemFeatureExtractor;
-import org.apache.ctakes.coreference.ae.features.DistanceFeatureExtractor;
-import org.apache.ctakes.coreference.ae.features.StringMatchingFeatureExtractor;
-import org.apache.ctakes.coreference.ae.features.TokenFeatureExtractor;
-import org.apache.ctakes.coreference.ae.features.UMLSFeatureExtractor;
 import org.apache.ctakes.relationextractor.ae.RelationExtractorAnnotator;
 import org.apache.ctakes.relationextractor.ae.features.RelationFeaturesExtractor;
+import org.apache.ctakes.temporal.ae.feature.coreference.DistSemFeatureExtractor;
+import org.apache.ctakes.temporal.ae.feature.coreference.DistanceFeatureExtractor;
+import org.apache.ctakes.temporal.ae.feature.coreference.StringMatchingFeatureExtractor;
+import org.apache.ctakes.temporal.ae.feature.coreference.TokenFeatureExtractor;
+import org.apache.ctakes.temporal.ae.feature.coreference.UMLSFeatureExtractor;
 import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation;
 import org.apache.ctakes.typesystem.type.relation.CoreferenceRelation;
 import org.apache.ctakes.typesystem.type.relation.RelationArgument;

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=1611031&r1=1611030&r2=1611031&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
Wed Jul 16 14:46:37 2014
@@ -114,7 +114,7 @@ public class EvaluationOfClearTKRelation
       File xmlDirectory,
       org.apache.ctakes.temporal.eval.Evaluation_ImplBase.XMLFormat xmlFormat,
       File xmiDirectory) {
-    super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, null, false,
false, defaultParams);
+    super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory, null, 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=1611031&r1=1611030&r2=1611031&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
Wed Jul 16 14:46:37 2014
@@ -16,8 +16,8 @@ import java.util.Stack;
 
 import org.apache.ctakes.core.resource.FileLocator;
 import org.apache.ctakes.core.util.DocumentIDAnnotationUtil;
-import org.apache.ctakes.coreference.ae.CoreferenceChainAnnotator;
 import org.apache.ctakes.relationextractor.eval.RelationExtractorEvaluation.HashableArguments;
+import org.apache.ctakes.temporal.ae.CoreferenceChainAnnotator;
 import org.apache.ctakes.temporal.ae.EventCoreferenceAnnotator;
 import org.apache.ctakes.temporal.eval.EvaluationOfEventTimeRelations.ParameterSettings;
 import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation;

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=1611031&r1=1611030&r2=1611031&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
Wed Jul 16 14:46:37 2014
@@ -152,6 +152,7 @@ EvaluationOfTemporalRelations_ImplBase{
 					options.getXMLFormat(),
 					options.getXMIDirectory(),
 					options.getTreebankDirectory(),
+					options.getCoreferenceDirectory(),
 					options.getClosure(),
 					options.getPrintErrors(),
 					options.getPrintFormattedRelations(),
@@ -198,6 +199,7 @@ EvaluationOfTemporalRelations_ImplBase{
 			XMLFormat xmlFormat,
 			File xmiDirectory,
 			File treebankDirectory,
+			File coreferenceDirectory,
 			boolean useClosure,
 			boolean printErrors,
 			boolean printRelations,
@@ -212,6 +214,7 @@ EvaluationOfTemporalRelations_ImplBase{
 				xmlFormat,
 				xmiDirectory,
 				treebankDirectory,
+				coreferenceDirectory,
 				printErrors,
 				printRelations,
 				params);
@@ -478,33 +481,6 @@ EvaluationOfTemporalRelations_ImplBase{
 		return result;
 	}
 	
-	private static Collection<BinaryTextRelation> correctArgOrder(
-			Collection<BinaryTextRelation> systemRelations,
-			Collection<BinaryTextRelation> goldRelations) {
-		Set<BinaryTextRelation> goodSys = Sets.newHashSet();
-
-		for(BinaryTextRelation sysrel : systemRelations){
-			Annotation sysArg1 = sysrel.getArg1().getArgument();
-			Annotation sysArg2 = sysrel.getArg2().getArgument();
-			for(BinaryTextRelation goldrel : goldRelations){
-				Annotation goldArg1 = goldrel.getArg1().getArgument();
-				Annotation goldArg2 = goldrel.getArg2().getArgument();
-				if (matchSpan(sysArg2, goldArg1) && matchSpan(sysArg1, goldArg2)){//the order
of system pair was flipped 
-					if(sysrel.getCategory().equals("OVERLAP")){ //if the relation is overlap, and the arg
order was flipped, then change back the order
-						RelationArgument tempArg = (RelationArgument) sysrel.getArg1().clone();
-						sysrel.setArg1((RelationArgument) sysrel.getArg2().clone());
-						sysrel.setArg2(tempArg);
-					}//for other types of relation, still maintain the type.
-					continue;
-				}
-			}
-			goodSys.add(sysrel);
-		}
-
-		return goodSys;
-	}
-
-
 //	@SuppressWarnings("unchecked")
 //	private static <SPAN> Collection<BinaryTextRelation> getDuplicateRelations(
 //			Collection<BinaryTextRelation> goldRelations,

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations.java?rev=1611031&r1=1611030&r2=1611031&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfTemporalRelations.java
Wed Jul 16 14:46:37 2014
@@ -218,6 +218,7 @@ EvaluationOfTemporalRelations_ImplBase{
 				xmlFormat,
 				xmiDirectory,
 				treebankDirectory,
+				null,
 				printErrors,
 				printRelations,
 				params);
@@ -487,32 +488,77 @@ EvaluationOfTemporalRelations_ImplBase{
   }
 	 */
 
-	//		private static <SPAN_TYPE> Collection<BinaryTextRelation> removeNonGoldRelations(
-	//				Collection<BinaryTextRelation> systemRelations,
-	//				Collection<BinaryTextRelation> goldRelations, Function<BinaryTextRelation,
?> getSpan) {
-	//			//remove non-gold pairs from system relations:
-	//			Set<BinaryTextRelation> goodSys = Sets.newHashSet();
-	//			Set<SPAN_TYPE> goldspans = new HashSet<SPAN_TYPE>();
-	//			
-	//			for (BinaryTextRelation relation : goldRelations) {
-	//				goldspans.add(((SPAN_TYPE) getSpan.apply(relation)));			
-	//			}
-	//			
-	//			for (BinaryTextRelation relation : systemRelations) {
-	//				if (goldspans.contains(((SPAN_TYPE) getSpan.apply(relation)))) {
-	//					goodSys.add(relation);
-	//				}
-	//			}
-	//			
-	//			return goodSys;
-	//		}
-
+//		private static <SPAN_TYPE> Collection<BinaryTextRelation> removeNonGoldRelations(
+//				Collection<BinaryTextRelation> systemRelations,
+//				Collection<BinaryTextRelation> goldRelations, Function<BinaryTextRelation,
?> getSpan) {
+//			//remove non-gold pairs from system relations:
+//			Set<BinaryTextRelation> goodSys = Sets.newHashSet();
+//			Set<SPAN_TYPE> goldspans = new HashSet<SPAN_TYPE>();
+//			
+//			for (BinaryTextRelation relation : goldRelations) {
+//				goldspans.add(((SPAN_TYPE) getSpan.apply(relation)));			
+//			}
+//			
+//			for (BinaryTextRelation relation : systemRelations) {
+//				if (goldspans.contains(((SPAN_TYPE) getSpan.apply(relation)))) {
+//					goodSys.add(relation);
+//				}
+//			}
+//			
+//			return goodSys;
+//		}
+	
 //	private static boolean matchSpan(Annotation arg1, Annotation arg2) {
 //		boolean result = false;
-//		if(arg1==null || arg2 == null) return result;
 //		result = arg1.getBegin() == arg2.getBegin() && arg1.getEnd() == arg2.getEnd();
 //		return result;
 //	}
+	
+//	protected static Collection<BinaryTextRelation> correctArgOrder(
+//			Collection<BinaryTextRelation> systemRelations,
+//			Collection<BinaryTextRelation> goldRelations) {
+//		Set<BinaryTextRelation> goodSys = Sets.newHashSet();
+//
+//		for(BinaryTextRelation sysrel : systemRelations){
+//			Annotation sysArg1 = sysrel.getArg1().getArgument();
+//			Annotation sysArg2 = sysrel.getArg2().getArgument();
+//			for(BinaryTextRelation goldrel : goldRelations){
+//				Annotation goldArg1 = goldrel.getArg1().getArgument();
+//				Annotation goldArg2 = goldrel.getArg2().getArgument();
+//				if (matchSpan(sysArg2, goldArg1) && matchSpan(sysArg1, goldArg2)){//the order
of system pair was flipped 
+//					if(sysrel.getCategory().equals("OVERLAP")){ //if the relation is overlap, and the
arg order was flipped, then change back the order
+//						RelationArgument tempArg = (RelationArgument) sysrel.getArg1().clone();
+//						sysrel.setArg1((RelationArgument) sysrel.getArg2().clone());
+//						sysrel.setArg2(tempArg);
+//					}//for other types of relation, still maintain the type.
+//					continue;
+//				}
+//			}
+//			goodSys.add(sysrel);
+//		}
+//
+//		return goodSys;
+//	}
+
+
+//	@SuppressWarnings("unchecked")
+//	private static <SPAN> Collection<BinaryTextRelation> getDuplicateRelations(
+//			Collection<BinaryTextRelation> goldRelations,
+//			Function<BinaryTextRelation, ?> getSpan) {
+//		Set<BinaryTextRelation> duplicateRelations = Sets.newHashSet();
+//		//build a multimap that map gold span to gold relation
+//		Multimap<SPAN, BinaryTextRelation> spanToRelation = HashMultimap.create();
+//		for (BinaryTextRelation relation : goldRelations) {
+//			spanToRelation.put((SPAN) getSpan.apply(relation), relation);			
+//		}
+//		for (SPAN span: spanToRelation.keySet()){
+//			Collection<BinaryTextRelation> relations = spanToRelation.get(span);
+//			if(relations.size()>1){//if same span maps to multiple relations
+//				duplicateRelations.addAll(relations);
+//			}
+//		}
+//		return duplicateRelations;
+//	}
 
 //	private static Collection<BinaryTextRelation> correctArgOrder(
 //			Collection<BinaryTextRelation> systemRelations,

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=1611031&r1=1611030&r2=1611031&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
Wed Jul 16 14:46:37 2014
@@ -20,6 +20,7 @@ package org.apache.ctakes.temporal.eval;
 
 import java.io.File;
 import java.util.Collection;
+import java.util.Set;
 
 import org.apache.ctakes.temporal.eval.EvaluationOfEventTimeRelations.ParameterSettings;
 import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation;
@@ -39,6 +40,7 @@ import org.uimafit.descriptor.Configurat
 import org.uimafit.util.JCasUtil;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import com.lexicalscope.jewel.cli.Option;
 
 public abstract class EvaluationOfTemporalRelations_ImplBase extends
@@ -56,6 +58,10 @@ public abstract class EvaluationOfTempor
 	    
 	    @Option
 	    public boolean getClosure();
+	    
+	    @Option
+	    public boolean getClassificationOnly();
+	    
 	  }
 	  
 	  protected static boolean DEFAULT_BOTH_DIRECTIONS = false;
@@ -72,11 +78,11 @@ public abstract class EvaluationOfTempor
 	  protected ParameterSettings params = null;
 	  protected boolean printRelations = false;
 
-	public EvaluationOfTemporalRelations_ImplBase(File baseDirectory,
+	  public EvaluationOfTemporalRelations_ImplBase(File baseDirectory,
 			File rawTextDirectory, File xmlDirectory, XMLFormat xmlFormat,
-			File xmiDirectory, File treebankDirectory, boolean printErrors, boolean printRelations,
ParameterSettings params) {
+			File xmiDirectory, File treebankDirectory, File coreferenceDirectory, boolean printErrors,
boolean printRelations, ParameterSettings params) {
 		super(baseDirectory, rawTextDirectory, xmlDirectory, xmlFormat, xmiDirectory,
-				treebankDirectory);
+				treebankDirectory, coreferenceDirectory);
 		this.params = params;
 		this.printRelations = printRelations;
 		this.printErrors =  printErrors;
@@ -148,6 +154,38 @@ public abstract class EvaluationOfTempor
     }
   }
 }
+  
+  protected static Collection<BinaryTextRelation> correctArgOrder(
+      Collection<BinaryTextRelation> systemRelations,
+      Collection<BinaryTextRelation> goldRelations) {
+    Set<BinaryTextRelation> goodSys = Sets.newHashSet();
+
+    for(BinaryTextRelation sysrel : systemRelations){
+      Annotation sysArg1 = sysrel.getArg1().getArgument();
+      Annotation sysArg2 = sysrel.getArg2().getArgument();
+      for(BinaryTextRelation goldrel : goldRelations){
+        Annotation goldArg1 = goldrel.getArg1().getArgument();
+        Annotation goldArg2 = goldrel.getArg2().getArgument();
+        if (matchSpan(sysArg2, goldArg1) && matchSpan(sysArg1, goldArg2)){//the order
of system pair was flipped 
+          if(sysrel.getCategory().equals("OVERLAP")){ //if the relation is overlap, and the
arg order was flipped, then change back the order
+            RelationArgument tempArg = (RelationArgument) sysrel.getArg1().clone();
+            sysrel.setArg1((RelationArgument) sysrel.getArg2().clone());
+            sysrel.setArg2(tempArg);
+          }//for other types of relation, still maintain the type.
+          continue;
+        }
+      }
+      goodSys.add(sysrel);
+    }
+
+    return goodSys;
+  }
+
+  private static boolean matchSpan(Annotation arg1, Annotation arg2) {
+    boolean result = false;
+    result = arg1.getBegin() == arg2.getBegin() && arg1.getEnd() == arg2.getEnd();
+    return result;
+  }
 
 	  protected static void printRelationAnnotations(String fileName, Collection<BinaryTextRelation>
relations) {
 

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=1611031&r1=1611030&r2=1611031&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
Wed Jul 16 14:46:37 2014
@@ -20,6 +20,7 @@ package org.apache.ctakes.temporal.eval;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
@@ -147,6 +148,9 @@ public abstract class Evaluation_ImplBas
     @Option(longName = "treebank", defaultToNull=true)
     public File getTreebankDirectory();
     
+    @Option(longName = "coreference", defaultToNull=true)
+    public File getCoreferenceDirectory();
+    
     @Option
     public boolean getUseGoldTrees();
     
@@ -181,6 +185,8 @@ public abstract class Evaluation_ImplBas
 
   protected File treebankDirectory;
   
+  protected File coreferenceDirectory;
+  
   protected boolean printErrors = false;
   
   protected boolean printOverlapping = false;
@@ -195,7 +201,8 @@ public abstract class Evaluation_ImplBas
       File xmlDirectory,
       XMLFormat xmlFormat,
       File xmiDirectory,
-      File treebankDirectory) {
+      File treebankDirectory,
+      File coreferenceDirectory) {
     super(baseDirectory);
     this.rawTextDirectory = rawTextDirectory;
     this.xmlDirectory = xmlDirectory;
@@ -203,6 +210,18 @@ public abstract class Evaluation_ImplBas
     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){
@@ -225,7 +244,7 @@ public abstract class Evaluation_ImplBas
     this.xmiExists = true;
   }
   
-  private List<File> getFilesFor(List<Integer> patientSets) {
+  private List<File> getFilesFor(List<Integer> patientSets) throws FileNotFoundException
{
 	  List<File> files = new ArrayList<File>();
 		if (this.rawTextDirectory == null
 		    && this.xmlFormat == XMLFormat.Anafora) {
@@ -260,13 +279,13 @@ public abstract class Evaluation_ImplBas
 		        System.err.println("Text file in training has no corresponding xml -- skipping:
" + train);
 		      }
 		    }
-		    File xmlText = new File(testDir, pt+".xml");
+		    File xmlTest = new File(testDir, pt+".xml");
 		    File test = new File(testDir, pt+".xml.txt");
-		    if(test.exists()){
-		      if(xmlText.exists()){
+		    if(xmlTest.exists()){
+		      if(test.exists()){
 		        files.add(test);
 		      }else{
-		        System.err.println("Text file in test has no corresponding xml -- skipping: " +
test);
+		        throw new FileNotFoundException("Could not find the test text file -- for cTAKES
usage you must copy the text files into the xml directory for the test set.");
 		      }
 		    }
 		    assert !(train.exists() && test.exists());
@@ -286,11 +305,21 @@ public abstract class Evaluation_ImplBas
 		        }else{
 		          // look for equivalent in xml directory:
 		          File xmlFile = new File(xmlDirectory, file.getName());
-		          if(xmlFile.exists()){
-		            files.add(file);
-		          }else{
-		            System.err.println("Missing patient file : " + xmlFile);
-		          }
+              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);
+              }
 		        }
 		      } 
 		    }
@@ -357,6 +386,13 @@ public abstract class Evaluation_ImplBas
       break;
     }
 
+    if(this.coreferenceDirectory != null){
+      aggregateBuilder.add(
+          THYMEAnaforaXMLReader.getDescription(this.coreferenceDirectory),
+          CAS.NAME_DEFAULT_SOFA,
+          GOLD_VIEW_NAME);
+    }
+    
     // identify segments
     if(this.xmlFormat == XMLFormat.I2B2){
       aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(SimpleSegmentAnnotator.class));
@@ -425,6 +461,7 @@ public abstract class Evaluation_ImplBas
     		UmlsDictionaryLookupAnnotator.createAnnotatorDescription()
     		);
 
+    /*
     // add lvg annotator
     String[] XeroxTreebankMap = {
         "adj|JJ",
@@ -487,6 +524,8 @@ public abstract class Evaluation_ImplBas
             new File(LvgCmdApiResourceImpl.class.getResource(
                 "/org/apache/ctakes/lvg/data/config/lvg.properties").toURI())));
     aggregateBuilder.add(lvgAnnotator);
+    */
+    aggregateBuilder.add(LvgAnnotator.createAnnotatorDescription());
 
     // add dependency parser
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(ClearNLPDependencyParserAE.class));
@@ -502,7 +541,9 @@ public abstract class Evaluation_ImplBas
       // add ctakes constituency parses to system view
       aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(ConstituencyParser.class,
           ConstituencyParser.PARAM_MODEL_FILENAME,
-          "org/apache/ctakes/constituency/parser/models/sharpacq-3.1.bin"));
+          "org/apache/ctakes/constituency/parser/models/thyme.bin"));
+//          "org/apache/ctakes/constituency/parser/models/sharp-3.1.bin"));
+//            "org/apache/ctakes/constituency/parser/models/thymeNotempeval.bin"));
 //      aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(BerkeleyParserWrapper.class,
 //          BerkeleyParserWrapper.PARAM_MODEL_FILENAME,
 //          



Mime
View raw message