ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1640825 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/ eval/
Date Thu, 20 Nov 2014 21:49:46 GMT
Author: clin
Date: Thu Nov 20 21:49:45 2014
New Revision: 1640825

URL: http://svn.apache.org/r1640825
Log:
check in the best i2b2 temporal result setting

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAdmissionTimeAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventDischargeTimeAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventI2B2RelationAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfI2B2TemporalRelations.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAdmissionTimeAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAdmissionTimeAnnotator.java?rev=1640825&r1=1640824&r2=1640825&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAdmissionTimeAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAdmissionTimeAnnotator.java
Thu Nov 20 21:49:45 2014
@@ -220,17 +220,17 @@ public class EventAdmissionTimeAnnotator
 						if(category!=null){
 							this.dataWriter.write(new Instance<>(category, features));
 							//add nearby system-generated events as additional instances
-							Collection<EventMention> eventList = coveringMap.get(eventMention);
-							for(EventMention covEvent : eventList){
-								if(!covEvent.getClass().equals(EventMention.class)){
-									List<Feature> covEvfeatures = extractFeatures(jCas,covEvent);
-									this.dataWriter.write(new Instance<>(category, covEvfeatures));
-								}
-							}
-							for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, eventMention)){//select
covered events
-								List<Feature> covedEvfeatures = extractFeatures(jCas,covedEvent);
-								this.dataWriter.write(new Instance<>(category, covedEvfeatures));
-							}
+//							Collection<EventMention> eventList = coveringMap.get(eventMention);
+//							for(EventMention covEvent : eventList){
+//								if(!covEvent.getClass().equals(EventMention.class)){
+//									List<Feature> covEvfeatures = extractFeatures(jCas,covEvent);
+//									this.dataWriter.write(new Instance<>(category, covEvfeatures));
+//								}
+//							}
+//							for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, eventMention)){//select
covered events
+//								List<Feature> covedEvfeatures = extractFeatures(jCas,covedEvent);
+//								this.dataWriter.write(new Instance<>(category, covedEvfeatures));
+//							}
 						}
 					} else {
 						String outcome = this.classifier.classify(features);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventDischargeTimeAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventDischargeTimeAnnotator.java?rev=1640825&r1=1640824&r2=1640825&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventDischargeTimeAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventDischargeTimeAnnotator.java
Thu Nov 20 21:49:45 2014
@@ -220,17 +220,17 @@ public class EventDischargeTimeAnnotator
 						if(category!=null){
 							this.dataWriter.write(new Instance<>(category, features));
 							//add nearby system-generated events as additional instances
-							Collection<EventMention> eventList = coveringMap.get(eventMention);
-							for(EventMention covEvent : eventList){
-								if(!covEvent.getClass().equals(EventMention.class)){
-									List<Feature> covEvfeatures = extractFeatures(jCas,covEvent);
-									this.dataWriter.write(new Instance<>(category, covEvfeatures));
-								}
-							}
-							for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, eventMention)){//select
covered events
-								List<Feature> covedEvfeatures = extractFeatures(jCas,covedEvent);
-								this.dataWriter.write(new Instance<>(category, covedEvfeatures));
-							}
+//							Collection<EventMention> eventList = coveringMap.get(eventMention);
+//							for(EventMention covEvent : eventList){
+//								if(!covEvent.getClass().equals(EventMention.class)){
+//									List<Feature> covEvfeatures = extractFeatures(jCas,covEvent);
+//									this.dataWriter.write(new Instance<>(category, covEvfeatures));
+//								}
+//							}
+//							for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, eventMention)){//select
covered events
+//								List<Feature> covedEvfeatures = extractFeatures(jCas,covedEvent);
+//								this.dataWriter.write(new Instance<>(category, covedEvfeatures));
+//							}
 						}
 					} else {
 						String outcome = this.classifier.classify(features);

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventI2B2RelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventI2B2RelationAnnotator.java?rev=1640825&r1=1640824&r2=1640825&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventI2B2RelationAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventI2B2RelationAnnotator.java
Thu Nov 20 21:49:45 2014
@@ -132,7 +132,7 @@ public class EventEventI2B2RelationAnnot
 				//	    		, new TemporalPETExtractor()
 				, new EventArgumentPropertyExtractor()
 				, new NumberOfEventTimeBetweenCandidatesExtractor()
-				, new SectionHeaderRelationExtractor()
+//				, new SectionHeaderRelationExtractor()
 				, new NearbyVerbTenseRelationExtractor()
 				, new CheckSpecialWordRelationExtractor()
 				, new UmlsFeatureExtractor()
@@ -146,10 +146,10 @@ public class EventEventI2B2RelationAnnot
 				, new ConjunctionRelationFeaturesExtractor()
 				//				, new DeterminerRelationFeaturesExtractor()
 				, new EventTimeRelationFeatureExtractor()
-				, new TokenPropertyFeaturesExtractor()
-				, new DependingVerbsFeatureExtractor()
-				, new SpecialAnnotationRelationExtractor() //not helpful
-				, new TemporalPETFlatExtractor()
+//				, new TokenPropertyFeaturesExtractor()
+//				, new DependingVerbsFeatureExtractor()
+//				, new SpecialAnnotationRelationExtractor() //not helpful
+//				, new TemporalPETFlatExtractor()
 				//				, new EventInBetweenPropertyExtractor()
 				//				, new EventOutsidePropertyExtractor()
 				);
@@ -186,28 +186,28 @@ public class EventEventI2B2RelationAnnot
 				EventMention eventA = events.get(j);
 
 				if(j-i==1 || j-i==eventNum-1||ifDependent(jCas, eventA, eventB)){
-					if(this.isTraining()){
-						//pairing covering system events:
-						for (EventMention event1 : coveringMap.get(eventA)){
-							for(EventMention event2 : coveringMap.get(eventB)){
-								pairs.add(new IdentifiedAnnotationPair(event1, event2));							
-							}
-							pairs.add(new IdentifiedAnnotationPair(event1, eventB));
-						}
-						for(EventMention event2 : coveringMap.get(eventB)){
-							pairs.add(new IdentifiedAnnotationPair(eventA, event2));							
-						}
-						//pairing covered system events:
-						for(EventMention event1 : JCasUtil.selectCovered(jCas, EventMention.class, eventA)){
-							for(EventMention event2 : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
-								pairs.add(new IdentifiedAnnotationPair(event1, event2));
-							}
-							pairs.add(new IdentifiedAnnotationPair(event1, eventB));
-						}
-						for(EventMention event2 : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
-							pairs.add(new IdentifiedAnnotationPair(eventA, event2));
-						}
-					}
+//					if(this.isTraining()){
+//						//pairing covering system events:
+//						for (EventMention event1 : coveringMap.get(eventA)){
+//							for(EventMention event2 : coveringMap.get(eventB)){
+//								pairs.add(new IdentifiedAnnotationPair(event1, event2));							
+//							}
+//							pairs.add(new IdentifiedAnnotationPair(event1, eventB));
+//						}
+//						for(EventMention event2 : coveringMap.get(eventB)){
+//							pairs.add(new IdentifiedAnnotationPair(eventA, event2));							
+//						}
+//						//pairing covered system events:
+//						for(EventMention event1 : JCasUtil.selectCovered(jCas, EventMention.class, eventA)){
+//							for(EventMention event2 : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
+//								pairs.add(new IdentifiedAnnotationPair(event1, event2));
+//							}
+//							pairs.add(new IdentifiedAnnotationPair(event1, eventB));
+//						}
+//						for(EventMention event2 : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
+//							pairs.add(new IdentifiedAnnotationPair(eventA, event2));
+//						}
+//					}
 					pairs.add(new IdentifiedAnnotationPair(eventA, eventB));
 				}
 			}

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java?rev=1640825&r1=1640824&r2=1640825&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
Thu Nov 20 21:49:45 2014
@@ -142,8 +142,8 @@ public class EventTimeI2B2RelationAnnota
 				, new ConjunctionRelationFeaturesExtractor()
 				//				, new EventPositionRelationFeaturesExtractor() //tried, but not helpful
 				, new TimeXRelationFeaturesExtractor()
-				, new TemporalPETFlatExtractor()
-				, new TimeXPropertyRelationFeaturesExtractor()
+//				, new TemporalPETFlatExtractor()
+//				, new TimeXPropertyRelationFeaturesExtractor()
 				//				, new TimeWordTypeRelationExtractor() //tried, but not helpful
 				//				, new EventIndexOfSameSentenceRelationFeaturesExtractor() //tried, but not helpful
 				);
@@ -172,14 +172,14 @@ public class EventTimeI2B2RelationAnnota
 				// ignore subclasses like Procedure and Disease/Disorder
 				if(this.isTraining()){//if training mode, train on both gold event and span-overlapping
system events
 					for (TimeMention time : JCasUtil.selectCovered(jCas, TimeMention.class, sentence)) {
-						Collection<EventMention> eventList = coveringMap.get(event);
-						for(EventMention covEvent : eventList){
-							pairs.add(new IdentifiedAnnotationPair(covEvent, time));
-						}
+//						Collection<EventMention> eventList = coveringMap.get(event);
+//						for(EventMention covEvent : eventList){
+//							pairs.add(new IdentifiedAnnotationPair(covEvent, time));
+//						}
 						pairs.add(new IdentifiedAnnotationPair(event, time));
-						for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, event)){//select
covered events
-							pairs.add(new IdentifiedAnnotationPair(covedEvent, time));
-						}
+//						for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, event)){//select
covered events
+//							pairs.add(new IdentifiedAnnotationPair(covedEvent, time));
+//						}
 					}
 				}else{//if testing mode, only test on system generated events
 					for (TimeMention time : JCasUtil.selectCovered(jCas, TimeMention.class, sentence)) {

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=1640825&r1=1640824&r2=1640825&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
Thu Nov 20 21:49:45 2014
@@ -304,15 +304,16 @@ EvaluationOfTemporalRelations_ImplBase{
 		aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(AddEEPotentialRelations.class));
 
 		aggregateBuilder.add(EventTimeI2B2RelationAnnotator.createDataWriterDescription(
-				//				LibSvmStringOutcomeDataWriter.class,
-				LibLinearStringOutcomeDataWriter.class,
+				LibSvmStringOutcomeDataWriter.class,
+//				LibLinearStringOutcomeDataWriter.class,
 				// TKSVMlightStringOutcomeDataWriter.class,
 				//        TKLIBSVMStringOutcomeDataWriter.class,
 				//        SVMlightStringOutcomeDataWriter.class,        
 				new File(directory,EVENT_TIME),
 				params.probabilityOfKeepingANegativeExample));
 		aggregateBuilder.add(EventEventI2B2RelationAnnotator.createDataWriterDescription(
-				LibLinearStringOutcomeDataWriter.class,//TKSVMlightStringOutcomeDataWriter.class,//
+				LibSvmStringOutcomeDataWriter.class,
+//				LibLinearStringOutcomeDataWriter.class,//TKSVMlightStringOutcomeDataWriter.class,//
 				//				LIBLINEARStringOutcomeDataWriter.class,
 				new File(directory,EVENT_EVENT), 
 				params.probabilityOfKeepingANegativeExample));
@@ -360,8 +361,8 @@ EvaluationOfTemporalRelations_ImplBase{
 		}
 
 		//    HideOutput hider = new HideOutput();
-		JarClassifierBuilder.trainAndPackage(new File(directory,EVENT_TIME), "-c", "0.0002", "-w2","0.5","-w3","5","-w4","8");//"-h","0","-c",
"1000");//optArray);//"-c", "0.05");//
-		JarClassifierBuilder.trainAndPackage(new File(directory,EVENT_EVENT), "-c", "0.0002","-w2","0.5","-w3","4","-w4","3");
+		JarClassifierBuilder.trainAndPackage(new File(directory,EVENT_TIME), "-h","0","-c", "1000",
"-w2","0.5","-w3","5","-w4","8");//"-h","0","-c", "1000");//optArray);//"-c", "0.05");//
+		JarClassifierBuilder.trainAndPackage(new File(directory,EVENT_EVENT), "-h","0","-c", "1000","-w2","0.5","-w3","4","-w4","3");
 		JarClassifierBuilder.trainAndPackage(new File(directory,EVENT_DISCHARGE), "-h","0","-c",
"1000");//,"-w2","23","-w3","24");
 		JarClassifierBuilder.trainAndPackage(new File(directory,EVENT_ADMISSION), "-h","0","-c",
"1000");//,"-w2","22","-w3","5");
 		//		JarClassifierBuilder.trainAndPackage(new File(directory,TIME_ADMISSION), "-h","0","-c",
"1000");



Mime
View raw message