Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 494E7200828 for ; Fri, 13 May 2016 20:12:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4806916099F; Fri, 13 May 2016 18:12:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 92CA91602BE for ; Fri, 13 May 2016 20:12:26 +0200 (CEST) Received: (qmail 60389 invoked by uid 500); 13 May 2016 18:12:25 -0000 Mailing-List: contact commits-help@ctakes.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ctakes.apache.org Delivered-To: mailing list commits@ctakes.apache.org Received: (qmail 60379 invoked by uid 99); 13 May 2016 18:12:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2016 18:12:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 523681A0252 for ; Fri, 13 May 2016 18:12:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.999 X-Spam-Level: X-Spam-Status: No, score=0.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Vjygl3CcSnu8 for ; Fri, 13 May 2016 18:12:24 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id 269525F477 for ; Fri, 13 May 2016 18:12:24 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 45C4EE009C for ; Fri, 13 May 2016 18:12:23 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 8BA683A0113 for ; Fri, 13 May 2016 18:12:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@ctakes.apache.org From: dligach@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160513181222.8BA683A0113@svn01-us-west.apache.org> archived-at: Fri, 13 May 2016 18:12:27 -0000 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(); } } }