ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1741335 - in /ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor: ae/LocationOfRelationExtractorAnnotator.java eval/RelationExtractorEvaluation.java
Date Wed, 27 Apr 2016 20:44:44 GMT
Author: clin
Date: Wed Apr 27 20:44:43 2016
New Revision: 1741335

URL: http://svn.apache.org/viewvc?rev=1741335&view=rev
Log:
for location-of only expand on covered events, don't expand on sites or covering events.

Modified:
    ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/LocationOfRelationExtractorAnnotator.java
    ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java

Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/LocationOfRelationExtractorAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/LocationOfRelationExtractorAnnotator.java?rev=1741335&r1=1741334&r2=1741335&view=diff
==============================================================================
--- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/LocationOfRelationExtractorAnnotator.java
(original)
+++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/LocationOfRelationExtractorAnnotator.java
Wed Apr 27 20:44:43 2016
@@ -62,16 +62,16 @@ public class LocationOfRelationExtractor
 		if(RelationExtractorEvaluation.expandEvent){//if expand
 			Map<EventMention, Collection<EventMention>> coveredMap =
 					JCasUtil.indexCovered(identifiedAnnotationView, EventMention.class, EventMention.class);
-			Map<EventMention, Collection<EventMention>> coveringMap =
-					JCasUtil.indexCovering(identifiedAnnotationView, EventMention.class, EventMention.class);
-			Map<AnatomicalSiteMention, Collection<EventMention>> siteEventMap =
-					JCasUtil.indexCovered(identifiedAnnotationView, AnatomicalSiteMention.class, EventMention.class);
-			Map<AnatomicalSiteMention, Collection<EntityMention>> siteEntityMap =
-					JCasUtil.indexCovering(identifiedAnnotationView, AnatomicalSiteMention.class, EntityMention.class);
+//			Map<EventMention, Collection<EventMention>> coveringMap =
+//					JCasUtil.indexCovering(identifiedAnnotationView, EventMention.class, EventMention.class);
+//			Map<AnatomicalSiteMention, Collection<EventMention>> siteEventMap =
+//					JCasUtil.indexCovered(identifiedAnnotationView, AnatomicalSiteMention.class, EventMention.class);
+//			Map<AnatomicalSiteMention, Collection<EntityMention>> siteEntityMap =
+//					JCasUtil.indexCovering(identifiedAnnotationView, AnatomicalSiteMention.class, EntityMention.class);
 			
 			final List<IdentifiedAnnotation> eventList = new ArrayList<>();
 			for (EventMention event : events) {
-				eventList.addAll(coveringMap.get(event));
+//				eventList.addAll(coveringMap.get(event));
 				eventList.addAll(coveredMap.get(event));
 				for(IdentifiedAnnotation covEvent : eventList){
 					for (AnatomicalSiteMention site : sites) {
@@ -83,14 +83,14 @@ public class LocationOfRelationExtractor
 				eventList.clear();
 				for (AnatomicalSiteMention site : sites) {
 					pairs.add(new IdentifiedAnnotationPair(event, site));
-					eventList.addAll(siteEventMap.get(site));
-					eventList.addAll(siteEntityMap.get(site));
-					for(IdentifiedAnnotation covSite : eventList){
-						if(!hasOverlap(event,covSite)){
-							pairs.add(new IdentifiedAnnotationPair(event, covSite));
-						}
-					}
-					eventList.clear();
+//					eventList.addAll(siteEventMap.get(site));
+//					eventList.addAll(siteEntityMap.get(site));
+//					for(IdentifiedAnnotation covSite : eventList){
+//						if(!hasOverlap(event,covSite)){
+//							pairs.add(new IdentifiedAnnotationPair(event, covSite));
+//						}
+//					}
+//					eventList.clear();
 				}
 				
 			}

Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java?rev=1741335&r1=1741334&r2=1741335&view=diff
==============================================================================
--- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
(original)
+++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
Wed Apr 27 20:44:43 2016
@@ -158,7 +158,7 @@ public class RelationExtractorEvaluation
 				LibLinearStringOutcomeDataWriter.class,
 				new Object[] { RelationExtractorAnnotator.PARAM_PROBABILITY_OF_KEEPING_A_NEGATIVE_EXAMPLE,
 						1.0f },//0.5f },//
-				new String[] { "-s", "0", "-c", "1.0" }));//
+				new String[] { "-s", "0", "-c", "50.0" }));//
 
 		RELATION_CLASSES.put("manages/treats", ManagesTreatsTextRelation.class);
 		ANNOTATOR_CLASSES.put(ManagesTreatsTextRelation.class, ManagesTreatsRelationExtractorAnnotator.class);
@@ -391,12 +391,12 @@ public class RelationExtractorEvaluation
 
 			Map<EventMention, Collection<EventMention>> coveredMap =
 					JCasUtil.indexCovered(relationView, EventMention.class, EventMention.class);
-			Map<EventMention, Collection<EventMention>> coveringMap =
-					JCasUtil.indexCovering(relationView, EventMention.class, EventMention.class);
-			Map<AnatomicalSiteMention, Collection<EventMention>> siteEventMap =
-					JCasUtil.indexCovered(relationView, AnatomicalSiteMention.class, EventMention.class);
-			Map<AnatomicalSiteMention, Collection<EntityMention>> siteEntityMap =
-					JCasUtil.indexCovering(relationView, AnatomicalSiteMention.class, EntityMention.class);
+//			Map<EventMention, Collection<EventMention>> coveringMap =
+//					JCasUtil.indexCovering(relationView, EventMention.class, EventMention.class);
+//			Map<AnatomicalSiteMention, Collection<EventMention>> siteEventMap =
+//					JCasUtil.indexCovered(relationView, AnatomicalSiteMention.class, EventMention.class);
+//			Map<AnatomicalSiteMention, Collection<EntityMention>> siteEntityMap =
+//					JCasUtil.indexCovering(relationView, AnatomicalSiteMention.class, EntityMention.class);
 			final List<IdentifiedAnnotation> eventList = new ArrayList<>();
 			for(LocationOfTextRelation relation : Lists.newArrayList(JCasUtil.select(relationView,
LocationOfTextRelation.class))){
 				Annotation arg1 = relation.getArg1().getArgument();
@@ -405,7 +405,7 @@ public class RelationExtractorEvaluation
 				if(arg1 instanceof EventMention && arg2 instanceof AnatomicalSiteMention){
 					event = (EventMention) arg1;
 
-					eventList.addAll(coveringMap.get(event));
+//					eventList.addAll(coveringMap.get(event));
 					eventList.addAll(coveredMap.get(event));
 					for(IdentifiedAnnotation covEvent : eventList){
 						if(!covEvent.getClass().equals(EventMention.class) && !hasOverlap(covEvent,
arg2)){
@@ -413,17 +413,17 @@ public class RelationExtractorEvaluation
 						}
 					}
 					eventList.clear();
-					eventList.addAll(siteEventMap.get(arg2));
-					eventList.addAll(siteEntityMap.get(arg2));
-					for(IdentifiedAnnotation covSite : eventList){
-						if(!covSite.getClass().equals(EventMention.class) && !hasOverlap(arg1, covSite)){
-							createRelation(relationView, event, covSite, relation.getCategory());
-						}
-					}
-					eventList.clear();
+//					eventList.addAll(siteEventMap.get(arg2));
+//					eventList.addAll(siteEntityMap.get(arg2));
+//					for(IdentifiedAnnotation covSite : eventList){
+//						if(!covSite.getClass().equals(EventMention.class) && !hasOverlap(arg1, covSite)){
+//							createRelation(relationView, event, covSite, relation.getCategory());
+//						}
+//					}
+//					eventList.clear();
 				}else if(arg2 instanceof EventMention && arg1 instanceof AnatomicalSiteMention){
 					event = (EventMention) arg2;
-					eventList.addAll(coveringMap.get(event));
+//					eventList.addAll(coveringMap.get(event));
 					eventList.addAll(coveredMap.get(event));
 					for(IdentifiedAnnotation covEvent : eventList){
 						if(!covEvent.getClass().equals(EventMention.class)&& !hasOverlap(arg1, covEvent)){
@@ -431,14 +431,14 @@ public class RelationExtractorEvaluation
 						}
 					}
 					eventList.clear();
-					eventList.addAll(siteEventMap.get(arg1));
-					eventList.addAll(siteEntityMap.get(arg1));
-					for(IdentifiedAnnotation covSite : eventList){
-						if(!covSite.getClass().equals(EventMention.class) && !hasOverlap(covSite, arg2)){
-							createRelation(relationView, covSite, event, relation.getCategory());
-						}
-					}
-					eventList.clear();
+//					eventList.addAll(siteEventMap.get(arg1));
+//					eventList.addAll(siteEntityMap.get(arg1));
+//					for(IdentifiedAnnotation covSite : eventList){
+//						if(!covSite.getClass().equals(EventMention.class) && !hasOverlap(covSite,
arg2)){
+//							createRelation(relationView, covSite, event, relation.getCategory());
+//						}
+//					}
+//					eventList.clear();
 				}
 			}
 



Mime
View raw message