ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1649645 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae: DocTimeRelAnnotator.java EventEventRelationAnnotator.java EventTimeSelfRelationAnnotator.java
Date Mon, 05 Jan 2015 20:25:09 GMT
Author: clin
Date: Mon Jan  5 20:25:09 2015
New Revision: 1649645

URL: http://svn.apache.org/r1649645
Log:
Use fewer features for DocTimeRel, event-time, event-event temporal relations.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java?rev=1649645&r1=1649644&r2=1649645&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
Mon Jan  5 20:25:09 2015
@@ -19,10 +19,12 @@
 package org.apache.ctakes.temporal.ae;
 
 import java.io.File;
+import java.util.ArrayList;
 //import java.io.IOException;
 import java.util.List;
 //import java.util.Map;
 
+
 import org.apache.ctakes.temporal.ae.feature.ClosestVerbExtractor;
 //import org.apache.ctakes.temporal.ae.feature.CoveredTextToValuesExtractor;
 import org.apache.ctakes.temporal.ae.feature.DateAndMeasurementExtractor;
@@ -100,14 +102,15 @@ public class DocTimeRelAnnotator extends
         new File(modelDirectory, "model.jar"));
   }
 
-  private CleartkExtractor contextExtractor;
-  private NearbyVerbTenseXExtractor verbTensePatternExtractor;
+  private CleartkExtractor contextExtractor;  
   private SectionHeaderExtractor sectionIDExtractor;
   private ClosestVerbExtractor closestVerbExtractor;
   private TimeXExtractor timeXExtractor;
   private EventPropertyExtractor genericExtractor;
-  private DateAndMeasurementExtractor dateExtractor;
   private UmlsSingleFeatureExtractor umlsExtractor;
+  private NearbyVerbTenseXExtractor verbTensePatternExtractor;
+  
+//  private DateAndMeasurementExtractor dateExtractor;  
 //  private CoveredTextToValuesExtractor disSemExtractor;
 //  private DurationExpectationFeatureExtractor durationExtractor;
   
@@ -123,13 +126,15 @@ public class DocTimeRelAnnotator extends
         new Preceding(3),
         new Covered(),
         new Following(3));
-    this.verbTensePatternExtractor = new NearbyVerbTenseXExtractor();
     this.sectionIDExtractor = new SectionHeaderExtractor();
     this.closestVerbExtractor = new ClosestVerbExtractor();
     this.timeXExtractor = new TimeXExtractor();
     this.genericExtractor = new EventPropertyExtractor();
-    this.dateExtractor = new DateAndMeasurementExtractor();
     this.umlsExtractor = new UmlsSingleFeatureExtractor();
+    this.verbTensePatternExtractor = new NearbyVerbTenseXExtractor();
+
+//    this.dateExtractor = new DateAndMeasurementExtractor();
+        
 //    try {
 //    	Map<String, double[]> word_disSem = CoveredTextToValuesExtractor.parseTextDoublesMap(new
File("src/main/resources/embeddings.size25.txt"), Charsets.UTF_8);
 //    	this.disSemExtractor = new CoveredTextToValuesExtractor("DisSemFeat", word_disSem);
@@ -142,16 +147,18 @@ public class DocTimeRelAnnotator extends
   @Override
   public void process(JCas jCas) throws AnalysisEngineProcessException {
     for (EventMention eventMention : JCasUtil.select(jCas, EventMention.class)) {
-      List<Feature> features = this.contextExtractor.extract(jCas, eventMention);
-      features.addAll(this.verbTensePatternExtractor.extract(jCas, eventMention));//add nearby
verb POS pattern feature
+      List<Feature> features = new ArrayList<>();//this.contextExtractor.extract(jCas,
eventMention);
       features.addAll(this.sectionIDExtractor.extract(jCas, eventMention)); //add section
heading
       features.addAll(this.closestVerbExtractor.extract(jCas, eventMention)); //add closest
verb
       features.addAll(this.timeXExtractor.extract(jCas, eventMention)); //add the closest
time expression types
       features.addAll(this.genericExtractor.extract(jCas, eventMention)); //add the closest
time expression types
-      features.addAll(this.dateExtractor.extract(jCas, eventMention)); //add the closest
NE type
       features.addAll(this.umlsExtractor.extract(jCas, eventMention)); //add umls features
-      //        features.addAll(this.durationExtractor.extract(jCas, eventMention)); //add
duration feature
-      //        features.addAll(this.disSemExtractor.extract(jCas, eventMention)); //add
distributional semantic features
+      features.addAll(this.verbTensePatternExtractor.extract(jCas, eventMention));//add nearby
verb POS pattern feature
+
+      //    
+      //    features.addAll(this.dateExtractor.extract(jCas, eventMention)); //add the closest
NE type
+      //    features.addAll(this.durationExtractor.extract(jCas, eventMention)); //add duration
feature
+      //    features.addAll(this.disSemExtractor.extract(jCas, eventMention)); //add distributional
semantic features
       if (this.isTraining()) {
     	  if(eventMention.getEvent() != null){
     		  String outcome = eventMention.getEvent().getProperties().getDocTimeRel();

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java?rev=1649645&r1=1649644&r2=1649645&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
Mon Jan  5 20:25:09 2015
@@ -130,17 +130,18 @@ public class EventEventRelationAnnotator
 				new TokenFeaturesExtractor()								
 				, new PartOfSpeechFeaturesExtractor()
 				, new EventArgumentPropertyExtractor()
-				, new NumberOfEventTimeBetweenCandidatesExtractor()
-				, new NearbyVerbTenseRelationExtractor()
-				, new CheckSpecialWordRelationExtractor()
 				, new UmlsFeatureExtractor()
-//				, new DependencyPathFeaturesExtractor()
-				, new CoordinateFeaturesExtractor()
+				, new DependencyPathFeaturesExtractor()
 				, new OverlappedHeadFeaturesExtractor()
-				, new SRLRelationFeaturesExtractor()
-				, new NumberOfEventsInTheSameSentenceExtractor()
-				, new ConjunctionRelationFeaturesExtractor()
-				, new EventTimeRelationFeatureExtractor()
+				
+//				, new NumberOfEventTimeBetweenCandidatesExtractor()
+//				, new NearbyVerbTenseRelationExtractor()
+//				, new CheckSpecialWordRelationExtractor()
+//				, new CoordinateFeaturesExtractor()
+//				, new SRLRelationFeaturesExtractor()
+//				, new NumberOfEventsInTheSameSentenceExtractor()
+//				, new ConjunctionRelationFeaturesExtractor()
+//				, new EventTimeRelationFeatureExtractor()
 
 //				new MultiTokenFeaturesExtractor()
 //				new UnexpandedTokenFeaturesExtractor() //use unexpanded version for i2b2 data

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java?rev=1649645&r1=1649644&r2=1649645&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
Mon Jan  5 20:25:09 2015
@@ -125,18 +125,19 @@ public class EventTimeSelfRelationAnnota
 	protected List<RelationFeaturesExtractor> getFeatureExtractors() {
 		return Lists.newArrayList(
 				new TokenFeaturesExtractor()							
-				, new PartOfSpeechFeaturesExtractor()
-				, new TemporalAttributeFeatureExtractor()
-				, new NumberOfEventTimeBetweenCandidatesExtractor()
-				, new NearbyVerbTenseRelationExtractor()
-				, new CheckSpecialWordRelationExtractor()
 				, new NearestFlagFeatureExtractor()
 				, new DependencyPathFeaturesExtractor()
-				, new DependencyFeatureExtractor()
 				, new EventArgumentPropertyExtractor()
-				, new OverlappedHeadFeaturesExtractor()
 				, new ConjunctionRelationFeaturesExtractor()
-				, new TimeXRelationFeaturesExtractor()
+				, new CheckSpecialWordRelationExtractor()
+				, new TemporalAttributeFeatureExtractor()
+
+//				, new DependencyFeatureExtractor()
+//				, new NumberOfEventTimeBetweenCandidatesExtractor()
+//				, new PartOfSpeechFeaturesExtractor()
+//				, new NearbyVerbTenseRelationExtractor()
+//				, new OverlappedHeadFeaturesExtractor()
+//				, new TimeXRelationFeaturesExtractor()
 
 //				new MultiTokenFeaturesExtractor()
 //				new UnexpandedTokenFeaturesExtractor() //use unexpanded version for i2b2 data



Mime
View raw message