ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shalg...@apache.org
Subject svn commit: r1508251 - in /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion: eval/AssertionEvaluation.java medfacts/cleartk/AssertionCleartkAnalysisEngine.java
Date Mon, 29 Jul 2013 23:59:24 GMT
Author: shalgrim
Date: Mon Jul 29 23:59:24 2013
New Revision: 1508251

URL: http://svn.apache.org/r1508251
Log:
improvements to historyOf. subsumedBy feature added. There may be some stuff to more easily
create a file for EA, too.

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/eval/AssertionEvaluation.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/eval/AssertionEvaluation.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/eval/AssertionEvaluation.java?rev=1508251&r1=1508250&r2=1508251&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/eval/AssertionEvaluation.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/eval/AssertionEvaluation.java
Mon Jul 29 23:59:24 2013
@@ -1128,6 +1128,9 @@ private static void output(Object o) {
 private static void printErrors(JCas jCas,
 		  Collection<IdentifiedAnnotation> goldEntitiesAndEvents,
 		  Collection<IdentifiedAnnotation> systemEntitiesAndEvents, String classifierType,
Object trueCategory, Class<? extends Object> categoryClass) throws ResourceProcessException
{
+
+	String documentId = DocumentIDAnnotationUtil.getDocumentID(jCas);
+	
 	  Map<HashableAnnotation, IdentifiedAnnotation> goldMap = Maps.newHashMap();
 	  for (IdentifiedAnnotation mention : goldEntitiesAndEvents) {
 		  goldMap.put(new HashableAnnotation(mention), mention);
@@ -1176,17 +1179,17 @@ private static void printErrors(JCas jCa
 					  // used for multi-class case:
 					  System.out.println(classifierType+" Incorrectly labeled as " + systemLabel + " when
the example was " + goldLabel + ": " + formatError(jCas, goldAnnotation));
 				  }else if(systemLabel.equals(trueCategory)){
-					  System.out.println(classifierType+" FP: " + typeId  + " " + formatError(jCas, systemAnnotation)
+ "| gold:|" + formatError(jCas, goldAnnotation));
+					  System.out.println(classifierType+" FP: " + typeId  + " " + formatError(jCas, systemAnnotation)
+ "| gold:|" + formatError(jCas, goldAnnotation) + " " + documentId);
 				  }else{
-					  System.out.println(classifierType+" FN: " + typeId + " " + formatError(jCas, goldAnnotation)+
"| system:|" + formatError(jCas, systemAnnotation));
+					  System.out.println(classifierType+" FN: " + typeId + " " + formatError(jCas, goldAnnotation)+
"| system:|" + formatError(jCas, systemAnnotation) + " " + documentId);
 				  }
 			  }else{
 			    if(trueCategory == null){
 			      // multi-class case -- probably don't want to print anything?
 			    }else if(systemLabel.equals(trueCategory)){
-					  System.out.println(classifierType+" TP: " + typeId + " " + formatError(jCas, systemAnnotation)
+ "| gold:|" + formatError(jCas, goldAnnotation));
+					  System.out.println(classifierType+" TP: " + typeId + " " + formatError(jCas, systemAnnotation)
+ "| gold:|" + formatError(jCas, goldAnnotation) + " " + documentId);
 				  }else{
-					  System.out.println(classifierType+" TN: " + typeId + " " + formatError(jCas, systemAnnotation)
+ "| gold:|" + formatError(jCas, goldAnnotation));
+					  System.out.println(classifierType+" TN: " + typeId + " " + formatError(jCas, systemAnnotation)
+ "| gold:|" + formatError(jCas, goldAnnotation) + " " + documentId);
 				  }
 			  }
 		  }

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java?rev=1508251&r1=1508250&r2=1508251&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/AssertionCleartkAnalysisEngine.java
Mon Jul 29 23:59:24 2013
@@ -27,6 +27,7 @@ import java.util.Random;
 
 import org.apache.ctakes.assertion.attributes.features.selection.FeatureSelection;
 import org.apache.ctakes.assertion.zoner.types.Zone;
+import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.structured.DocumentID;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.temporary.assertion.AssertionCuePhraseAnnotation;
@@ -358,7 +359,18 @@ public abstract class AssertionCleartkAn
 //      }
 
 
-      instance.add(new Feature("ENTITY_TYPE_" + entityOrEventMention.getTypeID()));
+      // 7/9/13 SRH trying to make it work just for anatomical site
+      int eemTypeId = entityOrEventMention.getTypeID(); 
+      if (eemTypeId == CONST.NE_TYPE_ID_ANATOMICAL_SITE) {
+          // 7/9/13 srh modified per tmiller so it's binary but not numeric feature
+          //instance.add(new Feature("ENTITY_TYPE_" + entityOrEventMention.getTypeID()));
+          instance.add(new Feature("ENTITY_TYPE_ANAT_SITE"));
+      } /* This hurts recall more than it helps precision
+      else if (eemTypeId == CONST.NE_TYPE_ID_DRUG) {
+    	  // 7/10 adding drug
+    	  instance.add(new Feature("ENTITY_TYPE_DRUG"));
+      }
+      */
       
       for (SimpleFeatureExtractor extractor : this.entityFeatureExtractors) {
         instance.addAll(extractor.extract(jCas, entityOrEventMention));



Mime
View raw message