ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1739119 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfBothEEAndETRelations.java
Date Thu, 14 Apr 2016 14:18:54 GMT
Author: clin
Date: Thu Apr 14 14:18:54 2016
New Revision: 1739119

URL: http://svn.apache.org/viewvc?rev=1739119&view=rev
Log:
enable "test-on-train" parameter.
remove timex-induced relations

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfBothEEAndETRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfBothEEAndETRelations.java?rev=1739119&r1=1739118&r2=1739119&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfBothEEAndETRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfBothEEAndETRelations.java
Thu Apr 14 14:18:54 2016
@@ -118,6 +118,9 @@ EvaluationOfTemporalRelations_ImplBase{
 
 		@Option
 		public boolean getWriteProbabilities();
+		
+		@Option
+		public boolean getTestOnTrain();
 	}
 
 	//  protected static boolean DEFAULT_BOTH_DIRECTIONS = false;
@@ -204,7 +207,13 @@ EvaluationOfTemporalRelations_ImplBase{
 			}
 			evaluation.writeProbabilities = options.getWriteProbabilities();
 
-			params.stats = evaluation.trainAndTest(training, testing);//training);//
+			//test or train or test
+			evaluation.testOnTrain = options.getTestOnTrain();
+			if(evaluation.testOnTrain){
+				params.stats = evaluation.trainAndTest(training, training);
+			}else{//test on testing set
+				params.stats = evaluation.trainAndTest(training, testing);//training
+			}
 			//      System.err.println(options.getKernelParams() == null ? params : options.getKernelParams());
 			//			System.err.println("No closure on gold::Closure on System::Recall Mode");
 			System.err.println(params.stats);
@@ -244,6 +253,7 @@ EvaluationOfTemporalRelations_ImplBase{
 	protected boolean skipTrain=false;
 	//  protected boolean printRelations = false;
 	private boolean writeProbabilities = false;
+	protected boolean testOnTrain=false;
 
 	public EvaluationOfBothEEAndETRelations(
 			File baseDirectory,
@@ -432,7 +442,7 @@ EvaluationOfTemporalRelations_ImplBase{
 		aggregateBuilder.add(aed);
 		
 		aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(CrossSentenceTemporalRelationAnnotator.class));
-		aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(WithinSentenceBeforeRelationAnnotator.class));
+//		aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(WithinSentenceBeforeRelationAnnotator.class));
 
 		if(this.anaforaOutput != null){
 			aed = AnalysisEngineFactory.createEngineDescription(WriteAnaforaXML.class, WriteAnaforaXML.PARAM_OUTPUT_DIR,
this.anaforaOutput);



Mime
View raw message