ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1661439 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal: ae/ eval/
Date Sat, 21 Feb 2015 19:50:07 GMT
Author: clin
Date: Sat Feb 21 19:50:06 2015
New Revision: 1661439

URL: http://svn.apache.org/r1661439
Log:
use unexpanded token features for event-time event-event relations.
remove UMLS filer for event-event annoator
remove inward expansion

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventEventThymeRelations.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java?rev=1661439&r1=1661438&r2=1661439&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotator.java
Sat Feb 21 19:50:06 2015
@@ -127,34 +127,34 @@ public class EventEventRelationAnnotator
 	@Override
 	protected List<RelationFeaturesExtractor> getFeatureExtractors() {
 		return Lists.newArrayList(
-				new TokenFeaturesExtractor()								
+				new UnexpandedTokenFeaturesExtractor() //new TokenFeaturesExtractor()								
 				, new PartOfSpeechFeaturesExtractor()
 				, new EventArgumentPropertyExtractor()
 				, new UmlsFeatureExtractor()
 				, new DependencyPathFeaturesExtractor()
 				, new OverlappedHeadFeaturesExtractor()
-				
-//				, new NumberOfEventTimeBetweenCandidatesExtractor()
-//				, new NearbyVerbTenseRelationExtractor()
-//				, new CheckSpecialWordRelationExtractor()
-//				, new CoordinateFeaturesExtractor()
-//				, new SRLRelationFeaturesExtractor()
-//				, new NumberOfEventsInTheSameSentenceExtractor()
-//				, new ConjunctionRelationFeaturesExtractor()
-//				, new EventTimeRelationFeatureExtractor()
-
-//				new MultiTokenFeaturesExtractor()
-//				new UnexpandedTokenFeaturesExtractor() //use unexpanded version for i2b2 data
-//				, new EmptyFeaturesExtractor()
-
-//				, new SectionHeaderRelationExtractor()
-//				, new EventPositionRelationFeaturesExtractor() //not helpful
-//				, new TimeXRelationFeaturesExtractor() //not helpful
-//				, new DeterminerRelationFeaturesExtractor()
-//				, new TokenPropertyFeaturesExtractor()
-//				, new DependingVerbsFeatureExtractor()
-//				, new SpecialAnnotationRelationExtractor() //not helpful
-//				, new TemporalPETFlatExtractor()
+
+				//				, new NumberOfEventTimeBetweenCandidatesExtractor()
+				//				, new NearbyVerbTenseRelationExtractor()
+				//				, new CheckSpecialWordRelationExtractor()
+				//				, new CoordinateFeaturesExtractor()
+				//				, new SRLRelationFeaturesExtractor()
+				//				, new NumberOfEventsInTheSameSentenceExtractor()
+				//				, new ConjunctionRelationFeaturesExtractor()
+				//				, new EventTimeRelationFeatureExtractor()
+
+				//				new MultiTokenFeaturesExtractor()
+				//				new UnexpandedTokenFeaturesExtractor() //use unexpanded version for i2b2 data
+				//				, new EmptyFeaturesExtractor()
+
+				//				, new SectionHeaderRelationExtractor()
+				//				, new EventPositionRelationFeaturesExtractor() //not helpful
+				//				, new TimeXRelationFeaturesExtractor() //not helpful
+				//				, new DeterminerRelationFeaturesExtractor()
+				//				, new TokenPropertyFeaturesExtractor()
+				//				, new DependingVerbsFeatureExtractor()
+				//				, new SpecialAnnotationRelationExtractor() //not helpful
+				//				, new TemporalPETFlatExtractor()
 
 				);
 	}
@@ -167,10 +167,10 @@ public class EventEventRelationAnnotator
 	@Override
 	protected List<IdentifiedAnnotationPair> getCandidateRelationArgumentPairs(
 			JCas jCas, Annotation sentence) {
-		
+
 		Map<EventMention, Collection<EventMention>> coveringMap =
 				JCasUtil.indexCovering(jCas, EventMention.class, EventMention.class);
-		
+
 		List<IdentifiedAnnotationPair> pairs = Lists.newArrayList();
 		List<EventMention> events = new ArrayList<>(JCasUtil.selectCovered(jCas, EventMention.class,
sentence));
 		//filter events:
@@ -188,45 +188,21 @@ public class EventEventRelationAnnotator
 			for(int j = i+1; j < eventNum; j++){
 				EventMention eventA = events.get(j);
 				EventMention eventB = events.get(i);
-				boolean eventAValid = false;
-				boolean eventBValid = false;
-				for (EventMention event : JCasUtil.selectCovered(jCas, EventMention.class, eventA)){
-					if(!event.getClass().equals(EventMention.class)){
-						eventAValid = true;
-						break;
-					}
-				}
-				for (EventMention event : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
-					if(!event.getClass().equals(EventMention.class)){
-						eventBValid = true;
-						break;
-					}
-				}
-				if(eventAValid && eventBValid){
-					if(this.isTraining()){
-						//pairing covering system events:
-						for (EventMention event1 : coveringMap.get(eventA)){
-							for(EventMention event2 : coveringMap.get(eventB)){
-								pairs.add(new IdentifiedAnnotationPair(event1, event2));
-							}
-							pairs.add(new IdentifiedAnnotationPair(event1, eventB));
-						}
+
+				if(this.isTraining()){
+					//pairing covering system events:
+					for (EventMention event1 : coveringMap.get(eventA)){
 						for(EventMention event2 : coveringMap.get(eventB)){
-							pairs.add(new IdentifiedAnnotationPair(eventA, event2));
+							pairs.add(new IdentifiedAnnotationPair(event1, event2));
 						}
-//						//pairing covered system events:
-//						for(EventMention event1 : JCasUtil.selectCovered(jCas, EventMention.class, eventA)){
-//							for(EventMention event2 : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
-//								pairs.add(new IdentifiedAnnotationPair(event1, event2));
-//							}
-//							pairs.add(new IdentifiedAnnotationPair(event1, eventB));
-//						}
-//						for(EventMention event2 : JCasUtil.selectCovered(jCas, EventMention.class, eventB)){
-//							pairs.add(new IdentifiedAnnotationPair(eventA, event2));
-//						}
+						pairs.add(new IdentifiedAnnotationPair(event1, eventB));
+					}
+					for(EventMention event2 : coveringMap.get(eventB)){
+						pairs.add(new IdentifiedAnnotationPair(eventA, event2));
 					}
-					pairs.add(new IdentifiedAnnotationPair(eventA, eventB));
 				}
+				pairs.add(new IdentifiedAnnotationPair(eventA, eventB));
+
 			}
 		}
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java?rev=1661439&r1=1661438&r2=1661439&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
Sat Feb 21 19:50:06 2015
@@ -124,7 +124,7 @@ public class EventTimeSelfRelationAnnota
 	@Override
 	protected List<RelationFeaturesExtractor> getFeatureExtractors() {
 		return Lists.newArrayList(
-				new TokenFeaturesExtractor()							
+				new UnexpandedTokenFeaturesExtractor()//new TokenFeaturesExtractor()							
 				, new NearestFlagFeatureExtractor()
 				, new DependencyPathFeaturesExtractor()
 				, new EventArgumentPropertyExtractor()
@@ -180,9 +180,6 @@ public class EventTimeSelfRelationAnnota
 							pairs.add(new IdentifiedAnnotationPair(covEvent, time));
 						}
 						pairs.add(new IdentifiedAnnotationPair(event, time));
-//						for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, event)){//select
covered events
-//							pairs.add(new IdentifiedAnnotationPair(covedEvent, time));
-//						}
 					}
 				}else{//if testing mode, only test on system generated events
 					for (TimeMention time : JCasUtil.selectCovered(jCas, TimeMention.class, sentence)) {

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventEventThymeRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventEventThymeRelations.java?rev=1661439&r1=1661438&r2=1661439&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventEventThymeRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventEventThymeRelations.java
Sat Feb 21 19:50:06 2015
@@ -537,16 +537,6 @@ EvaluationOfTemporalRelations_ImplBase{
 					for(EventMention covEventB : coveringMap.get(event2)){
 						createRelation(relationView, event1, covEventB, relation.getCategory());
 					}
-					//get covered system events:
-					for(EventMention covedEventA : JCasUtil.selectCovered(jCas, EventMention.class, event1)){//select
covered events
-						for(EventMention covedEventB : JCasUtil.selectCovered(jCas, EventMention.class, event2)){
-							createRelation(relationView, covedEventA, covedEventB, relation.getCategory());
-						}
-						createRelation(relationView, covedEventA, event2, relation.getCategory());
-					}
-					for(EventMention covedEventB : JCasUtil.selectCovered(jCas, EventMention.class, event2)){
-						createRelation(relationView, event1, covedEventB, relation.getCategory());
-					}
 				}
 			}
 

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java?rev=1661439&r1=1661438&r2=1661439&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/EvaluationOfEventTimeRelations.java
Sat Feb 21 19:50:06 2015
@@ -694,9 +694,6 @@ EvaluationOfTemporalRelations_ImplBase{
 							createRelation(relationView, covEvent, arg2, relation.getCategory());
 						}
 					}
-					for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, event)){//select
covered events
-						createRelation(relationView, covedEvent, arg2, relation.getCategory());
-					}
 				}else if(arg2 instanceof EventMention && arg1 instanceof TimeMention){
 					event = (EventMention) arg2;
 					Collection<EventMention> eventList = coveringMap.get(event);
@@ -705,9 +702,6 @@ EvaluationOfTemporalRelations_ImplBase{
 							createRelation(relationView, arg1, covEvent, relation.getCategory());
 						}
 					}
-					for(EventMention covedEvent : JCasUtil.selectCovered(jCas, EventMention.class, event)){//select
covered events
-						createRelation(relationView, arg1, covedEvent, relation.getCategory());
-					}
 				}
 			}
 



Mime
View raw message