ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1488245 - /ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
Date Fri, 31 May 2013 14:18:41 GMT
Author: dligach
Date: Fri May 31 14:18:41 2013
New Revision: 1488245

URL: http://svn.apache.org/r1488245
Log:
filtering out obvious classifier errors

Modified:
    ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java

Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java?rev=1488245&r1=1488244&r2=1488245&view=diff
==============================================================================
--- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
(original)
+++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
Fri May 31 14:18:41 2013
@@ -25,7 +25,6 @@ import java.util.List;
 import org.apache.ctakes.relationextractor.eval.XMIReader;
 import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation;
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
-import org.apache.ctakes.typesystem.type.textspan.Sentence;
 import org.apache.uima.analysis_engine.AnalysisEngine;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.cas.CAS;
@@ -83,7 +82,6 @@ public class RelationAnnotationViewer {
         throw new AnalysisEngineProcessException(e);
       }   
       
-      System.out.println();
       for(BinaryTextRelation binaryTextRelation : JCasUtil.select(systemView, BinaryTextRelation.class))
{
         IdentifiedAnnotation entity1; // entity whose role is "Argument"
         IdentifiedAnnotation entity2; // entity whose role is "Related_to"
@@ -97,11 +95,20 @@ public class RelationAnnotationViewer {
         }
         
         String category = binaryTextRelation.getCategory();
-        String arg1 = entity1.getCoveredText();
-        String arg2 = entity2.getCoveredText();
+        String arg1 = entity1.getCoveredText().toLowerCase();
+        String arg2 = entity2.getCoveredText().toLowerCase();
         int type1 = entity1.getTypeID();
         int type2 = entity2.getTypeID();
         
+        // skip location_of(anatomical site, anatomical site)
+        if(type1 == 6 && type2 == 6) {
+          continue; 
+        }
+        // "to" is not a valid disease/disorder
+        if(type2 == 3 && arg2.equals("to")) {
+          continue;
+        }
+        
         // print relation and its arguments: location_of(colon/6, colon cancer/2)
         System.out.format("%s(%s/%d, %s/%d)\n", category, arg1, type1, arg2, type2);
       }



Mime
View raw message