ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1716225 - in /ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference: ae/MentionClusterCoreferenceAnnotator.java eval/EvaluationOfEventCoreference.java
Date Tue, 24 Nov 2015 18:07:25 GMT
Author: tmill
Date: Tue Nov 24 18:07:25 2015
New Revision: 1716225

URL: http://svn.apache.org/viewvc?rev=1716225&view=rev
Log:
Parameterized scorer location and bug with person names.

Modified:
    ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
    ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/eval/EvaluationOfEventCoreference.java

Modified: ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java?rev=1716225&r1=1716224&r2=1716225&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
(original)
+++ ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/ae/MentionClusterCoreferenceAnnotator.java
Tue Nov 24 18:07:25 2015
@@ -118,7 +118,7 @@ public class MentionClusterCoreferenceAn
     extractors.add(new MentionClusterDepHeadExtractor());
     extractors.add(new MentionClusterStackFeaturesExtractor());
     extractors.add(new MentionClusterSalienceFeaturesExtractor());
-    extractors.add(new MentionClusterAttributeFeaturesExtractor());
+//    extractors.add(new MentionClusterAttributeFeaturesExtractor());
 //    extractors.add(new MentionClusterDistanceFeaturesExtractor());
     
     try {
@@ -141,7 +141,7 @@ public class MentionClusterCoreferenceAn
     extractors.add(new MentionClusterSalienceFeaturesExtractor());
 
     extractors.add(new MentionClusterMentionFeaturesExtractor());
-    extractors.add(new MentionClusterAttributeFeaturesExtractor());
+//    extractors.add(new MentionClusterAttributeFeaturesExtractor());
 
     return extractors;
   }

Modified: ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/eval/EvaluationOfEventCoreference.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/eval/EvaluationOfEventCoreference.java?rev=1716225&r1=1716224&r2=1716225&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/eval/EvaluationOfEventCoreference.java
(original)
+++ ctakes/sandbox/ctakes-coref-cleartk/src/main/java/org/apache/ctakes/coreference/eval/EvaluationOfEventCoreference.java
Tue Nov 24 18:07:25 2015
@@ -117,11 +117,14 @@ public class EvaluationOfEventCoreferenc
     @Option(longName="external")
     public boolean getUseExternalScorer();
     
-    @Option(shortName="t", defaultValue={"MENTION_PAIR"})
+    @Option(shortName="t", defaultValue={"MENTION_CLUSTER"})
     public EVAL_SYSTEM getEvalSystem();
     
     @Option(shortName="c", defaultValue="default")
     public String getConfig();
+    
+    @Option(shortName="s")
+    public String getScorerPath();
   }
   
   private static Logger logger = Logger.getLogger(EvaluationOfEventCoreference.class);
@@ -191,7 +194,7 @@ public class EvaluationOfEventCoreferenc
       Runtime runtime = Runtime.getRuntime();
       Process p = runtime.exec(new String[]{
           "perl",
-          "/home/tmill/soft/reference-coreference-scorers/scorer.pl",
+          options.getScorerPath(),
           "all",
           options.getOutputDirectory() + goldOut,
           options.getOutputDirectory() + systemOut,
@@ -333,7 +336,6 @@ public class EvaluationOfEventCoreferenc
     aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ParagraphVectorAnnotator.class));
     aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(RelationPropagator.class));
     aggregateBuilder.add(BackwardsTimeAnnotator.createAnnotatorDescription("/org/apache/ctakes/temporal/ae/timeannotator/model.jar"));
-    aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(DeterministicMarkableAnnotator.class));
     aggregateBuilder.add(EventAnnotator.createAnnotatorDescription());
     aggregateBuilder.add(DocTimeRelAnnotator.createAnnotatorDescription("/org/apache/ctakes/temporal/ae/doctimerel/model.jar"));
     aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(CoreferenceChainScoringOutput.class,
@@ -341,6 +343,7 @@ public class EvaluationOfEventCoreferenc
         this.outputDirectory + goldOut,
         CoreferenceChainScoringOutput.PARAM_GOLD_VIEW_NAME,
         GOLD_VIEW_NAME));
+    aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(DeterministicMarkableAnnotator.class));
     aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(RemovePersonMarkables.class));
     aggregateBuilder.add(MarkableSalienceAnnotator.createAnnotatorDescription("/org/apache/ctakes/temporal/ae/salience/model.jar"));
     if(this.evalType == EVAL_SYSTEM.MENTION_PAIR){
@@ -714,7 +717,7 @@ public class EvaluationOfEventCoreferenc
         if(coveredTokens.size() == 1 && coveredTokens.get(0).getPartOfSpeech().startsWith("PRP")
&&
             !markable.getCoveredText().toLowerCase().equals("it")){
           toRemove.add(markable);
-        }else if(coveredTokens.size() == 2 && 
+        }else if((coveredTokens.size() == 2 || coveredTokens.size() == 3) && 
             (coveredTokens.get(0).getCoveredText().startsWith("Mr.") || coveredTokens.get(0).getCoveredText().startsWith("Dr.")
||
                 coveredTokens.get(0).getCoveredText().startsWith("Mrs.") || coveredTokens.get(0).getCoveredText().startsWith("Ms."))){
           toRemove.add(markable);



Mime
View raw message