ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1588360 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature: DependencyParseUtils.java DependencyPathFeaturesExtractor.java
Date Thu, 17 Apr 2014 20:17:51 GMT
Author: clin
Date: Thu Apr 17 20:17:50 2014
New Revision: 1588360

URL: http://svn.apache.org/r1588360
Log:
fix a dependency error. added dependency distance as a feature

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyParseUtils.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyParseUtils.java?rev=1588360&r1=1588359&r2=1588360&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyParseUtils.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyParseUtils.java
Thu Apr 17 20:17:50 2014
@@ -73,7 +73,7 @@ public class DependencyParseUtils {
     for (ConllDependencyNode depNode : JCasUtil.selectCovered(jcas, ConllDependencyNode.class,
annotation)) {
 
       ConllDependencyNode head = depNode.getHead();
-      if (head == null || head.getEnd() <= annotation.getBegin() || head.getBegin() >
annotation.getEnd()) {
+      if (head == null || head.getHead()==null||head.getEnd() <= annotation.getBegin()
|| head.getBegin() > annotation.getEnd()) {
         // The head is outside the bounds of the annotation, so this node must be the annotation's
head
         return depNode;
       }

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyPathFeaturesExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyPathFeaturesExtractor.java?rev=1588360&r1=1588359&r2=1588360&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyPathFeaturesExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DependencyPathFeaturesExtractor.java
Thu Apr 17 20:17:50 2014
@@ -47,6 +47,7 @@ public class DependencyPathFeaturesExtra
 
     LinkedList<ConllDependencyNode> node1ToNode2Path = DependencyParseUtils.getPathBetweenNodes(node1,
node2);
     features.add(new Feature("dependency_path", DependencyParseUtils.pathToString(node1ToNode2Path)));
+    features.add(new Feature("dependency_path_length", node1ToNode2Path.size()));//add path
length as a feature
 
     return features;
   }



Mime
View raw message