ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1743714 - /ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
Date Fri, 13 May 2016 18:12:22 GMT
Author: dligach
Date: Fri May 13 18:12:21 2016
New Revision: 1743714

URL: http://svn.apache.org/viewvc?rev=1743714&view=rev
Log:
only including "forward" relations

Modified:
    ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java

Modified: ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java?rev=1743714&r1=1743713&r2=1743714&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
(original)
+++ ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
Fri May 13 18:12:21 2016
@@ -121,37 +121,30 @@ public class PositiveAndNegativeExampleP
               continue;
             }
             BinaryTextRelation relation = relationLookup.get(Arrays.asList(mention1, mention2));
-
+            if(mention1.getBegin() > mention2.getBegin()) {
+              continue; // will worry about this later  
+            }
+            
             String label;
             if(relation == null) {
-              label = "0";    // no relation
-            } else if(relation.getCategory().equals("CONTAINS")) {
-              if(mention1.getBegin() < mention2.getBegin()) {
-                label = "1";  // arg1 left of arg2
-              } else { 
-                label = "0"; // arg2 left of arg1; IGNORE THOSE FOR NOW
-              }
-            } else {    
-              label = "0";    // non-contains relation
+              label = "none";
+            } else {
+              label = relation.getCategory().toLowerCase();
             }
 
             String context = getTextBetweenAnnotations(systemView, mention1, mention2); 
-            String text = String.format("%s|%s|%s|%s", 
-                label,
-                mention1.getCoveredText(), 
-                mention2.getCoveredText(), 
-                context);
-            eventEventRelationsInSentence.add(text);
+            String text = String.format("%s|%s", label, context);
+            eventEventRelationsInSentence.add(text.toLowerCase());
           }
         }
 
         if(eventEventRelationsInSentence.size() > 0) {
-          String sentText = annotateEvents(eventMentionsInSentence, sentence);
-          System.out.println(sentText);
+          // String sentText = annotateEvents(eventMentionsInSentence, sentence);
+          // System.out.println(sentText);
           for(String text : eventEventRelationsInSentence) {
             System.out.println(text);
           }
-          System.out.println();
+          // System.out.println();
         }
       }
     }



Mime
View raw message