incubator-ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1431575 - /incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/Baseline2EntityMentionPairRelationExtractorAnnotator.java
Date Thu, 10 Jan 2013 19:39:57 GMT
Author: dligach
Date: Thu Jan 10 19:39:57 2013
New Revision: 1431575

URL: http://svn.apache.org/viewvc?rev=1431575&view=rev
Log:
bug fixes

Modified:
    incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/Baseline2EntityMentionPairRelationExtractorAnnotator.java

Modified: incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/Baseline2EntityMentionPairRelationExtractorAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/Baseline2EntityMentionPairRelationExtractorAnnotator.java?rev=1431575&r1=1431574&r2=1431575&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/Baseline2EntityMentionPairRelationExtractorAnnotator.java
(original)
+++ incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/Baseline2EntityMentionPairRelationExtractorAnnotator.java
Thu Jan 10 19:39:57 2013
@@ -44,8 +44,9 @@ import com.google.common.base.Functions;
 import com.google.common.collect.Ordering;
 
 /**
- * Annotate location_of relation between two entities in sentences containing
- * exactly two entities (where the entities are of the correct types).
+ * Annotate location_of relation between two entities in sentences with multiple anatomica
sites
+ * and a single legitimate location_of arg2. Use the pair of arguments that are the closest
to each other.
+ * This implementation assumes classifyBothDirections = true.
  */
 public class Baseline2EntityMentionPairRelationExtractorAnnotator extends RelationExtractorAnnotator
{
 	
@@ -86,15 +87,15 @@ public class Baseline2EntityMentionPairR
 			}
 		}
 
-		// need sentences with a single legitimate arg2 and multiple anatomical sties
+		// look for sentences with one legitimate arg2 and multiple anatomical sties (arg1)
 		int legitimateArg1Count = 0;
 		int legitimateArg2Count = 0;
-		for(IdentifiedAnnotationPair pair : pairs) {
-		  if(pair.getArg1().getTypeID() == 6) {
+		for(EntityMention entityMention : args) {
+		  if(entityMention.getTypeID() == 6) {
 		    legitimateArg1Count++;
 		  }
 		  HashSet<Integer> okArg2Types = new HashSet<Integer>(Arrays.asList(2, 3, 5));
-		  if(okArg2Types.contains(pair.getArg2().getTypeID())) {
+		  if(okArg2Types.contains(entityMention.getTypeID())) {
 		    legitimateArg2Count++;
 		  }
 		}
@@ -135,6 +136,9 @@ public class Baseline2EntityMentionPairR
     return result;
 	}
 	
+	/* 
+	 * Calculate the distance (in tokens) between two identified annotations.
+	 */
 	private static int getDistance(JCas jCas, IdentifiedAnnotationPair pair)  {
 	  
 	  List<BaseToken> baseTokens = JCasUtil.selectBetween(jCas, BaseToken.class, pair.getArg1(),
pair.getArg2());



Mime
View raw message