ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1812450 - /ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
Date Tue, 17 Oct 2017 20:26:06 GMT
Author: tmill
Date: Tue Oct 17 20:26:05 2017
New Revision: 1812450

URL: http://svn.apache.org/viewvc?rev=1812450&view=rev
Log:
Added some debugging statements for cross-document coref.

Modified:
    ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java

Modified: ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java?rev=1812450&r1=1812449&r2=1812450&view=diff
==============================================================================
--- ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
(original)
+++ ctakes/trunk/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
Tue Oct 17 20:26:05 2017
@@ -300,9 +300,12 @@ public class MentionClusterCoreferenceAn
         boolean singleton = true;
         double maxScore = 0.0;
         CollectionTextRelation maxCluster = null;
+        String mentionView = mention.getView().getViewName();
 
         for ( CollectionTextRelationIdentifiedAnnotationPair pair : this.getCandidateRelationArgumentPairs(
jCas, mention ) ) {
           CollectionTextRelation cluster = pair.getCluster();
+          Markable firstElement = JCasUtil.select(cluster.getMembers(), Markable.class).iterator().next();
+          String clusterHeadView = firstElement.getView().getViewName();
 //System.out.println( "   MCCA Pair Cluster: " + pair.getCluster().getCategory() );
           // apply all the feature extractors to extract the list of features
           List<Feature> features = new ArrayList<>();
@@ -362,6 +365,9 @@ public class MentionClusterCoreferenceAn
               if ( greedyFirst ) {
                 createRelation( jCas, cluster, mention, predictedCategory, scores.get( predictedCategory
) );
                 singleton = false;
+                if(!clusterHeadView.equals(mentionView)){
+                  LOGGER.info("Linking new mention to cluster with elements from previous
document");
+                }
                 // break here for "closest-first" greedy decoding strategy (Soon et al.,
2001), terminology from Lasalle and Denis (2013),
                 // for "best first" need to keep track of all relations with scores and only
keep the highest
                 break;



Mime
View raw message