incubator-ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevenbeth...@apache.org
Subject svn commit: r1438758 - /incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Date Fri, 25 Jan 2013 23:18:44 GMT
Author: stevenbethard
Date: Fri Jan 25 23:18:44 2013
New Revision: 1438758

URL: http://svn.apache.org/viewvc?rev=1438758&view=rev
Log:
Reorders EventAnnotator features, putting simplest features first

Modified:
    incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java

Modified: incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java?rev=1438758&r1=1438757&r2=1438758&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
(original)
+++ incubator/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Fri Jan 25 23:18:44 2013
@@ -253,9 +253,19 @@ public class EventAnnotator extends Clea
 
         List<Feature> features = new ArrayList<Feature>();
 
+        // features from previous classifications
+        for (int i = nPreviousClassifications; i > 0; --i) {
+          int index = tokenIndex - i;
+          String previousOutcome = index < 0 ? "O" : outcomes.get(index);
+          features.add(new Feature("PreviousOutcome_" + i, previousOutcome));
+        }
+        
         // features from token attributes
         features.addAll(this.tokenFeatureExtractor.extract(jCas, token));
 
+        // features from surrounding tokens
+        features.addAll(this.contextFeatureExtractor.extractWithin(jCas, token, sentence));
+
         // features from surrounding entity, phrase, etc. chunk-labels
         for (ChunkingExtractor extractor : chunkingExtractors) {
           features.addAll(extractor.extract(tokenIndex, nChunkLabelsBefore, nChunkLabelsAfter));
@@ -264,16 +274,6 @@ public class EventAnnotator extends Clea
         // features from semantic roles
         features.addAll(predicateArgumentExtractor.extract(token));
 
-        // features from surrounding tokens
-        features.addAll(this.contextFeatureExtractor.extractWithin(jCas, token, sentence));
-
-        // features from previous classifications
-        for (int i = nPreviousClassifications; i > 0; --i) {
-          int index = tokenIndex - i;
-          String previousOutcome = index < 0 ? "O" : outcomes.get(index);
-          features.add(new Feature("PreviousOutcome_" + i, previousOutcome));
-        }
-        
         // apply feature selection, if necessary
         if (this.featureSelection != null) {
           features = this.featureSelection.transform(features);



Mime
View raw message