ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1636654 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventProperties.java
Date Tue, 04 Nov 2014 17:24:15 GMT
Author: clin
Date: Tue Nov  4 17:24:15 2014
New Revision: 1636654

URL: http://svn.apache.org/r1636654
Log:
allow event-property evaluation script to skip Train, and only serialize test patients' xmis

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=1636654&r1=1636653&r2=1636654&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
Tue Nov  4 17:24:15 2014
@@ -79,6 +79,9 @@ Evaluation_ImplBase<Map<String, Annotati
 
 		@Option
 		public boolean getUseGoldAttributes();
+
+		@Option
+		public boolean getSkipTrain();
 	}
 	private static final String DOC_TIME_REL = "docTimeRel";
 	private static final String CONTEXTUAL_MODALITY = "contextualModality";
@@ -107,7 +110,12 @@ Evaluation_ImplBase<Map<String, Annotati
 					options.getXMLDirectory(),
 					options.getXMLFormat(),
 					options.getXMIDirectory());
-			evaluation.prepareXMIsFor(patientSets);
+			evaluation.skipTrain = options.getSkipTrain();
+			if(evaluation.skipTrain && options.getTest()){
+				evaluation.prepareXMIsFor(testItems);
+			}else{
+				evaluation.prepareXMIsFor(patientSets);
+			}
 			evaluation.logClassificationErrors(workingDir, "ctakes-event-property-errors");
 
 			Map<String, AnnotationStatistics<String>> stats = evaluation.trainAndTest(trainItems,
testItems);
@@ -129,6 +137,7 @@ Evaluation_ImplBase<Map<String, Annotati
 	}
 
 	private Map<String, Logger> loggers = Maps.newHashMap();
+	protected boolean skipTrain=false;
 
 	public EvaluationOfEventProperties(
 			File baseDirectory,
@@ -144,6 +153,8 @@ Evaluation_ImplBase<Map<String, Annotati
 
 	@Override
 	protected void train(CollectionReader collectionReader, File directory) throws Exception
{
+		//	  if(this.baseline) return;
+		if(this.skipTrain) return;
 		AggregateBuilder aggregateBuilder = this.getPreprocessorAggregateBuilder();
 		aggregateBuilder.add(CopyFromGold.getDescription(EventMention.class));
 		aggregateBuilder.add(CopyFromGold.getDescription(TimeMention.class));



Mime
View raw message