ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1550543 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DurationEventEventFeatureExtractor.java
Date Thu, 12 Dec 2013 21:43:36 GMT
Author: dligach
Date: Thu Dec 12 21:43:36 2013
New Revision: 1550543

URL: http://svn.apache.org/r1550543
Log:
added duration distribution features

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DurationEventEventFeatureExtractor.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DurationEventEventFeatureExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DurationEventEventFeatureExtractor.java?rev=1550543&r1=1550542&r2=1550543&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DurationEventEventFeatureExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DurationEventEventFeatureExtractor.java
Thu Dec 12 21:43:36 2013
@@ -57,16 +57,22 @@ public class DurationEventEventFeatureEx
     if(arg1Distribution == null) {
       features.add(new Feature("arg1_no_duration_info"));
     } else {
-      float expectation1 = DurationExpectationFeatureExtractor.expectedDuration(arg1Distribution);
-      features.add(new Feature("arg1_expected_duration", expectation1));
+//      float expectation1 = DurationExpectationFeatureExtractor.expectedDuration(arg1Distribution);
+//      features.add(new Feature("arg1_expected_duration", expectation1));
+      for(String timeUnit : arg1Distribution.keySet()) {
+        features.add(new Feature("duration_" + timeUnit, arg1Distribution.get(timeUnit)));
 
+      }
     }
     
     Map<String, Float> arg2Distribution = textToDistribution.get(arg2text);
     if(arg2Distribution == null) {
       features.add(new Feature("arg2_no_duration_info"));
     } else {
-      float expectation2 = DurationExpectationFeatureExtractor.expectedDuration(arg2Distribution);
-      features.add(new Feature("arg2_expected_duration", expectation2));
+//      float expectation2 = DurationExpectationFeatureExtractor.expectedDuration(arg2Distribution);
+//      features.add(new Feature("arg_expected_duration", expectation2));
+      for(String timeUnit : arg2Distribution.keySet()) {
+        features.add(new Feature("duration_" + timeUnit, arg2Distribution.get(timeUnit)));
 
+      }
     }
     
     return features;



Mime
View raw message