You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by tm...@apache.org on 2015/11/24 15:28:06 UTC
svn commit: r1716150 - in
/ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae:
MentionClusterRankingCoreferenceAnnotator.java
features/cluster/MentionClusterAttributeFeaturesExtractor.java
Author: tmill
Date: Tue Nov 24 14:28:06 2015
New Revision: 1716150
URL: http://svn.apache.org/viewvc?rev=1716150&view=rev
Log:
Attributes added to ranking svm version.
Modified:
ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterRankingCoreferenceAnnotator.java
ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/features/cluster/MentionClusterAttributeFeaturesExtractor.java
Modified: ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterRankingCoreferenceAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterRankingCoreferenceAnnotator.java?rev=1716150&r1=1716149&r2=1716150&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterRankingCoreferenceAnnotator.java (original)
+++ ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterRankingCoreferenceAnnotator.java Tue Nov 24 14:28:06 2015
@@ -14,6 +14,7 @@ import java.util.Set;
import org.apache.ctakes.core.util.ListFactory;
import org.apache.ctakes.coreference.ae.features.cluster.MentionClusterAgreementFeaturesExtractor;
+import org.apache.ctakes.coreference.ae.features.cluster.MentionClusterAttributeFeaturesExtractor;
import org.apache.ctakes.coreference.ae.features.cluster.MentionClusterDepHeadExtractor;
import org.apache.ctakes.coreference.ae.features.cluster.MentionClusterDistSemExtractor;
import org.apache.ctakes.coreference.ae.features.cluster.MentionClusterMentionFeaturesExtractor;
@@ -122,6 +123,7 @@ public class MentionClusterRankingCorefe
extractors.add(new MentionClusterStackFeaturesExtractor());
extractors.add(new MentionClusterSalienceFeaturesExtractor());
// extractors.add(new MentionClusterDistanceFeaturesExtractor());
+ extractors.add(new MentionClusterAttributeFeaturesExtractor());
try {
extractors.add(new MentionClusterDistSemExtractor());
@@ -136,7 +138,14 @@ public class MentionClusterRankingCorefe
protected List<FeatureExtractor1<Markable>> getMentionExtractors(){
List<FeatureExtractor1<Markable>> extractors = new ArrayList<>();
// mention features from pairwise system:
+ extractors.add(new MentionClusterAgreementFeaturesExtractor());
+ extractors.add(new MentionClusterSectionFeaturesExtractor());
+ extractors.add(new MentionClusterUMLSFeatureExtractor());
+ extractors.add(new MentionClusterDepHeadExtractor());
+ extractors.add(new MentionClusterSalienceFeaturesExtractor());
+
extractors.add(new MentionClusterMentionFeaturesExtractor());
+ extractors.add(new MentionClusterAttributeFeaturesExtractor());
return extractors;
}
Modified: ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/features/cluster/MentionClusterAttributeFeaturesExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/features/cluster/MentionClusterAttributeFeaturesExtractor.java?rev=1716150&r1=1716149&r2=1716150&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/features/cluster/MentionClusterAttributeFeaturesExtractor.java (original)
+++ ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/features/cluster/MentionClusterAttributeFeaturesExtractor.java Tue Nov 24 14:28:06 2015
@@ -39,7 +39,10 @@ public class MentionClusterAttributeFeat
boolean clusterTimex = false; // if any cluster member is timex
boolean matchUnc = true;
- for(IdentifiedAnnotation member : new ListIterable<IdentifiedAnnotation>(cluster.getMembers())){
+ for(Markable member : JCasUtil.select(cluster.getMembers(), Markable.class)){
+ if(member.getBegin() > mention.getEnd()){
+ break;
+ }
if(mentionNegated != isNegated(member)){
matchNeg = false;
}