ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1582425 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
Date Thu, 27 Mar 2014 17:47:04 GMT
Author: clin
Date: Thu Mar 27 17:47:04 2014
New Revision: 1582425

URL: http://svn.apache.org/r1582425
Log:
Current DocTimeRel annotator with UMLS feature extractor.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.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=1582425&r1=1582424&r2=1582425&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
Thu Mar 27 17:47:04 2014
@@ -19,14 +19,19 @@
 package org.apache.ctakes.temporal.ae;
 
 import java.io.File;
+//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;
 import org.apache.ctakes.temporal.ae.feature.EventPropertyExtractor;
 import org.apache.ctakes.temporal.ae.feature.NearbyVerbTenseXExtractor;
 import org.apache.ctakes.temporal.ae.feature.SectionHeaderExtractor;
 import org.apache.ctakes.temporal.ae.feature.TimeXExtractor;
+import org.apache.ctakes.temporal.ae.feature.UmlsSingleFeatureExtractor;
+//import org.apache.ctakes.temporal.ae.feature.duration.DurationExpectationFeatureExtractor;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.textsem.EventMention;
 import org.apache.uima.UimaContext;
@@ -51,6 +56,8 @@ import org.cleartk.classifier.jar.Generi
 import org.uimafit.factory.AnalysisEngineFactory;
 import org.uimafit.util.JCasUtil;
 
+//import com.google.common.base.Charsets;
+
 public class DocTimeRelAnnotator extends CleartkAnnotator<String> {
 
   public static AnalysisEngineDescription createDataWriterDescription(
@@ -83,7 +90,10 @@ public class DocTimeRelAnnotator extends
   private TimeXExtractor timeXExtractor;
   private EventPropertyExtractor genericExtractor;
   private DateAndMeasurementExtractor dateExtractor;
-
+  private UmlsSingleFeatureExtractor umlsExtractor;
+//  private CoveredTextToValuesExtractor disSemExtractor;
+//  private DurationExpectationFeatureExtractor durationExtractor;
+  
   @Override
   public void initialize(UimaContext context) throws ResourceInitializationException {
     super.initialize(context);
@@ -102,6 +112,14 @@ public class DocTimeRelAnnotator extends
     this.timeXExtractor = new TimeXExtractor();
     this.genericExtractor = new EventPropertyExtractor();
     this.dateExtractor = new DateAndMeasurementExtractor();
+    this.umlsExtractor = new UmlsSingleFeatureExtractor();
+//    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);
+//	} catch (IOException e) {
+//		e.printStackTrace();
+//	}
+//    this.durationExtractor = new DurationExpectationFeatureExtractor();
   }
 
   @Override
@@ -115,6 +133,9 @@ public class DocTimeRelAnnotator extends
         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
         if (this.isTraining()) {
           String outcome = eventMention.getEvent().getProperties().getDocTimeRel();
           this.dataWriter.write(new Instance<String>(outcome, features));



Mime
View raw message