ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1493877 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel: EventTimeFlatTreeFeatureExtractor.java TemporalFTExtractor.java TemporalPETExtractor.java TemporalPathExtractor.java
Date Mon, 17 Jun 2013 18:45:50 GMT
Author: tmill
Date: Mon Jun 17 18:45:49 2013
New Revision: 1493877

URL: http://svn.apache.org/r1493877
Log:
Updated tk features to use cleartk TreeFeatureVector.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/EventTimeFlatTreeFeatureExtractor.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalFTExtractor.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPETExtractor.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPathExtractor.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/EventTimeFlatTreeFeatureExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/EventTimeFlatTreeFeatureExtractor.java?rev=1493877&r1=1493876&r2=1493877&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/EventTimeFlatTreeFeatureExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/EventTimeFlatTreeFeatureExtractor.java
Mon Jun 17 18:45:49 2013
@@ -12,6 +12,7 @@ import org.apache.ctakes.utils.tree.Simp
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.cleartk.classifier.Feature;
+import org.cleartk.classifier.TreeFeature;
 import org.uimafit.util.JCasUtil;
 
 import com.google.common.base.Function;
@@ -34,8 +35,8 @@ public class EventTimeFlatTreeFeatureExt
 		SimpleTree bopTree = getTree(jcas, arg1, arg2, "BOP", new Function<BaseToken,String>(){public
String apply(BaseToken t){ return t.getPartOfSpeech();}});
 		SimpleTree bowTree = getTree(jcas, arg1, arg2, "BOW", new Function<BaseToken,String>(){public
String apply(BaseToken t){ return t.getCoveredText();}});
 		
-		feats.add(new Feature("TK_BOP_Tree", bopTree.toString()));
-		feats.add(new Feature("TK_BOW_Tree", bowTree.toString()));
+		feats.add(new TreeFeature("TK_BOP_Tree", bopTree.toString()));
+		feats.add(new TreeFeature("TK_BOW_Tree", bowTree.toString()));
 		return feats;
 	}
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalFTExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalFTExtractor.java?rev=1493877&r1=1493876&r2=1493877&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalFTExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalFTExtractor.java
Mon Jun 17 18:45:49 2013
@@ -15,6 +15,7 @@ import org.apache.ctakes.utils.tree.Simp
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.cleartk.classifier.Feature;
+import org.cleartk.classifier.TreeFeature;
 
 public class TemporalFTExtractor implements RelationFeaturesExtractor {
 
@@ -29,7 +30,7 @@ public class TemporalFTExtractor impleme
 		
 		if(root == null){
 			SimpleTree fakeTree = new SimpleTree("(S (NN null))");
-			features.add(new Feature(FEAT_NAME, fakeTree.toString()));
+			features.add(new TreeFeature(FEAT_NAME, fakeTree.toString()));
 			return features;
 		}
 		
@@ -79,7 +80,7 @@ public class TemporalFTExtractor impleme
 
 		TemporalPETExtractor.moveTimexDownToNP(tree);
 		
-		features.add(new Feature(FEAT_NAME, tree.toString()));
+		features.add(new TreeFeature(FEAT_NAME, tree.toString()));
 		return features;
 	}
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPETExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPETExtractor.java?rev=1493877&r1=1493876&r2=1493877&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPETExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPETExtractor.java
Mon Jun 17 18:45:49 2013
@@ -15,6 +15,7 @@ import org.apache.ctakes.utils.tree.Simp
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.cleartk.classifier.Feature;
+import org.cleartk.classifier.TreeFeature;
 import org.uimafit.util.JCasUtil;
 
 public class TemporalPETExtractor implements RelationFeaturesExtractor {
@@ -28,7 +29,7 @@ public class TemporalPETExtractor implem
 		
 		if(root == null){
 			SimpleTree fakeTree = new SimpleTree("(S (NN null))");
-			features.add(new Feature("TK_PET", fakeTree.toString()));
+			features.add(new TreeFeature("TK_PET", fakeTree.toString()));
 			return features;
 		}
 		
@@ -77,7 +78,7 @@ public class TemporalPETExtractor implem
 
 		moveTimexDownToNP(tree);
 		
-		features.add(new Feature("TK_PET", tree.toString()));
+		features.add(new TreeFeature("TK_PET", tree.toString()));
 		return features;
 	}
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPathExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPathExtractor.java?rev=1493877&r1=1493876&r2=1493877&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPathExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/treekernel/TemporalPathExtractor.java
Mon Jun 17 18:45:49 2013
@@ -15,6 +15,7 @@ import org.apache.ctakes.utils.tree.Simp
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.cleartk.classifier.Feature;
+import org.cleartk.classifier.TreeFeature;
 
 public class TemporalPathExtractor implements RelationFeaturesExtractor {
 
@@ -26,7 +27,7 @@ public class TemporalPathExtractor imple
 		TopTreebankNode root = AnnotationTreeUtils.getTreeCopy(jcas, AnnotationTreeUtils.getAnnotationTree(jcas,
arg1));
 		if(root == null){
 			SimpleTree fakeTree = new SimpleTree("(S (NN null))");
-			features.add(new Feature("TK_PATH", fakeTree.toString()));
+			features.add(new TreeFeature("TK_PATH", fakeTree.toString()));
 			return features;
 		}
 		// swap the order if necessary:
@@ -70,7 +71,7 @@ public class TemporalPathExtractor imple
 		tree = TreeExtractor.extractPathTree(t1, t2);
 //		}
 
-		features.add(new Feature("TK_PATH", tree.toString()));
+		features.add(new TreeFeature("TK_PATH", tree.toString()));
 		return features;
 	}
 



Mime
View raw message