ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevenbeth...@apache.org
Subject svn commit: r1391275 - in /incubator/ctakes/trunk: ./ ctakes-assertion/ ctakes-dependency-parser/ ctakes-relation-extractor/ ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/ ctakes-relation-extractor/src/main/java/org/apa...
Date Fri, 28 Sep 2012 00:40:11 GMT
Author: stevenbethard
Date: Fri Sep 28 00:40:10 2012
New Revision: 1391275

URL: http://svn.apache.org/viewvc?rev=1391275&view=rev
Log:
Updates to ClearTK 1.2.0, and removes copy of ClearTK 1.2.0-SNAPSHOT code which was in ctakes-relation-extractor

Removed:
    incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/chboston/
    incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/cleartk/
Modified:
    incubator/ctakes/trunk/ctakes-assertion/pom.xml
    incubator/ctakes/trunk/ctakes-dependency-parser/pom.xml
    incubator/ctakes/trunk/ctakes-relation-extractor/pom.xml
    incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/ModifierExtractorAnnotator.java
    incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
    incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
    incubator/ctakes/trunk/pom.xml

Modified: incubator/ctakes/trunk/ctakes-assertion/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-assertion/pom.xml?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-assertion/pom.xml (original)
+++ incubator/ctakes/trunk/ctakes-assertion/pom.xml Fri Sep 28 00:40:10 2012
@@ -34,10 +34,6 @@
 		</dependency>
 		<dependency>
 			<groupId>org.cleartk</groupId>
-			<artifactId>cleartk-chunker</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.cleartk</groupId>
 			<artifactId>cleartk-ml</artifactId>
 		</dependency>
 		<dependency>

Modified: incubator/ctakes/trunk/ctakes-dependency-parser/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-dependency-parser/pom.xml?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-dependency-parser/pom.xml (original)
+++ incubator/ctakes/trunk/ctakes-dependency-parser/pom.xml Fri Sep 28 00:40:10 2012
@@ -8,6 +8,13 @@
 		<artifactId>ctakes</artifactId>
 		<version>3.0.0-SNAPSHOT</version>
 	</parent>
+	<!-- necessary for ClearParser -->
+	<repositories>
+		<repository>
+			<id>cleartk-googlecode</id>
+			<url>http://cleartk.googlecode.com/svn/repo/</url>
+		</repository>
+	</repositories>
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.ctakes</groupId>

Modified: incubator/ctakes/trunk/ctakes-relation-extractor/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-relation-extractor/pom.xml?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-relation-extractor/pom.xml (original)
+++ incubator/ctakes/trunk/ctakes-relation-extractor/pom.xml Fri Sep 28 00:40:10 2012
@@ -27,7 +27,7 @@
 		</dependency>
 			<dependency>
 				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-chunker</artifactId>
+				<artifactId>cleartk-eval</artifactId>
 			</dependency>
 			<dependency>
 				<groupId>org.cleartk</groupId>

Modified: incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/ModifierExtractorAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/ModifierExtractorAnnotator.java?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/ModifierExtractorAnnotator.java
(original)
+++ incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/ModifierExtractorAnnotator.java
Fri Sep 28 00:40:10 2012
@@ -69,7 +69,7 @@ public class ModifierExtractorAnnotator 
       List<String> outcomes;
       if (this.isTraining()) {
         List<Modifier> modifiers = JCasUtil.selectCovered(jCas, Modifier.class, sentence);
-        outcomes = this.chunking.toOutcomes(jCas, tokens, modifiers);
+        outcomes = this.chunking.createOutcomes(jCas, tokens, modifiers);
       }
 
       // during prediction, the list of outcomes predicted so far
@@ -115,7 +115,7 @@ public class ModifierExtractorAnnotator 
 
       // convert classifications to Modifiers
       if (!this.isTraining()) {
-        this.chunking.toChunks(jCas, tokens, outcomes);
+        this.chunking.createChunks(jCas, tokens, outcomes);
       }
     }
 

Modified: incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
(original)
+++ incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
Fri Sep 28 00:40:10 2012
@@ -47,7 +47,7 @@ import org.uimafit.util.JCasUtil;
 import org.apache.ctakes.relationextractor.ae.ModifierExtractorAnnotator;
 import org.apache.ctakes.typesystem.type.textsem.Modifier;
 
-public class ModifierExtractorEvaluation extends Evaluation_ImplBase<File, AnnotationStatistics>
{
+public class ModifierExtractorEvaluation extends Evaluation_ImplBase<File, AnnotationStatistics<String>>
{
 
   public static class Options extends Options_ImplBase {
     @Option(
@@ -70,8 +70,8 @@ public class ModifierExtractorEvaluation
         "-c",
         "1000");
 
-    List<AnnotationStatistics> foldStats = evaluation.crossValidation(trainFiles, 2);
-    AnnotationStatistics overallStats = AnnotationStatistics.addAll(foldStats);
+    List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(trainFiles,
2);
+    AnnotationStatistics<String> overallStats = AnnotationStatistics.addAll(foldStats);
     System.err.println("Overall:");
     System.err.println(overallStats);
   }
@@ -111,13 +111,13 @@ public class ModifierExtractorEvaluation
   }
 
   @Override
-  protected AnnotationStatistics test(CollectionReader collectionReader, File directory)
+  protected AnnotationStatistics<String> test(CollectionReader collectionReader, File
directory)
       throws Exception {
     AnalysisEngine classifierAnnotator = AnalysisEngineFactory.createPrimitive(ModifierExtractorAnnotator.getDescription(
         GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
         new File(directory, "model.jar").getPath()));
 
-    AnnotationStatistics stats = new AnnotationStatistics();
+    AnnotationStatistics<String> stats = new AnnotationStatistics<String>();
     for (JCas jCas : new JCasIterable(collectionReader, classifierAnnotator)) {
       JCas goldView;
       try {

Modified: incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
(original)
+++ incubator/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
Fri Sep 28 00:40:10 2012
@@ -73,7 +73,7 @@ import org.apache.ctakes.typesystem.type
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
 import org.apache.ctakes.typesystem.type.textsem.Modifier;
 
-public class RelationExtractorEvaluation extends Evaluation_ImplBase<File, AnnotationStatistics>
{
+public class RelationExtractorEvaluation extends Evaluation_ImplBase<File, AnnotationStatistics<String>>
{
 
   public static class Options extends Options_ImplBase {
 
@@ -159,7 +159,7 @@ public class RelationExtractorEvaluation
       
       if(options.testDirectory == null) {
       	// run n-fold cross-validation
-      	List<AnnotationStatistics> foldStats = evaluation.crossValidation(trainFiles,
2);
+      	List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(trainFiles,
2);
       	params.stats = AnnotationStatistics.addAll(foldStats);
         
       	System.err.println("overall:");
@@ -177,7 +177,8 @@ public class RelationExtractorEvaluation
       	evaluation.train(trainCollectionReader, modelsDir);
       	
       	CollectionReader testCollectionReader = evaluation.getCollectionReader(testFiles);
-      	AnnotationStatistics stats = evaluation.test(testCollectionReader, modelsDir);
+      	AnnotationStatistics<String> stats = evaluation.test(testCollectionReader, modelsDir);
+        System.err.print(stats);
       	return;
       }
     }
@@ -291,7 +292,7 @@ public class RelationExtractorEvaluation
   }
 
   @Override
-  protected AnnotationStatistics test(CollectionReader collectionReader, File directory)
+  protected AnnotationStatistics<String> test(CollectionReader collectionReader, File
directory)
       throws Exception {
     AggregateBuilder builder = new AggregateBuilder();
     // replace cTAKES entity mentions and modifiers in the system view with the gold annotations
@@ -307,7 +308,14 @@ public class RelationExtractorEvaluation
     builder.add(classifierAnnotator);
 
     // statistics will be based on the "category" feature of the BinaryTextRelations
-    AnnotationStatistics stats = new AnnotationStatistics("category");
+    AnnotationStatistics<String> stats = new AnnotationStatistics<String>();
+    Function<BinaryTextRelation, HashableArguments> getSpan = new Function<BinaryTextRelation,
HashableArguments>() {
+      @Override
+      public HashableArguments apply(BinaryTextRelation relation) {
+        return new HashableArguments(relation);
+      }
+    };
+    Function<BinaryTextRelation, String> getOutcome = AnnotationStatistics.annotationToFeatureValue("category");
 
     // calculate statistics, iterating over the results of the classifier
     AnalysisEngine engine = builder.createAggregate();
@@ -333,12 +341,8 @@ public class RelationExtractorEvaluation
       stats.add(
           goldBinaryTextRelations,
           systemBinaryTextRelations,
-          new Function<BinaryTextRelation, HashableArguments>() {
-            @Override
-            public HashableArguments apply(BinaryTextRelation relation) {
-              return new HashableArguments(relation);
-            }
-          });
+          getSpan,
+          getOutcome);
     }
 
     System.err.println(directory.getName() + ":");
@@ -426,7 +430,7 @@ public class RelationExtractorEvaluation
 
     public double svmGamma;
 
-    public AnnotationStatistics stats;
+    public AnnotationStatistics<String> stats;
 
     private static List<String> SVM_KERNELS = Arrays.asList(
         "linear",

Modified: incubator/ctakes/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/pom.xml?rev=1391275&r1=1391274&r2=1391275&view=diff
==============================================================================
--- incubator/ctakes/trunk/pom.xml (original)
+++ incubator/ctakes/trunk/pom.xml Fri Sep 28 00:40:10 2012
@@ -13,12 +13,6 @@
 		<developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/ctakes/</developerConnection>
 		<url>https://svn.apache.org/repos/asf/incubator/ctakes/</url>
 	</scm>
-	<repositories>
-		<repository>
-			<id>cleartk-googlecode</id>
-			<url>http://cleartk.googlecode.com/svn/repo/</url>
-		</repository>
-	</repositories>
 	<properties>
 		<ctakes.version>3.0.0-SNAPSHOT</ctakes.version>
 		<maven.compiler.source>1.6</maven.compiler.source>
@@ -220,40 +214,13 @@
 				<artifactId>xercesImpl</artifactId>
 				<version>2.10.0</version>
 			</dependency>
+			<!-- import a consistent set of versions for all ClearTK modules -->
 			<dependency>
 				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-chunker</artifactId>
-				<version>1.0.1</version>
-			</dependency>
-			<dependency>
-				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-eval</artifactId>
-				<version>0.8.1</version>
-			</dependency>
-			<dependency>
-				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-ml</artifactId>
-				<version>1.0.1</version>
-			</dependency>
-			<dependency>
-				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-ml-libsvm</artifactId>
-				<version>1.0.1</version>
-			</dependency>
-			<dependency>
-				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-ml-opennlp-maxent</artifactId>
-				<version>1.0.2</version>
-			</dependency>
-			<dependency>
-				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-test-util</artifactId>
-				<version>1.0.1</version>
-			</dependency>
-			<dependency>
-				<groupId>org.cleartk</groupId>
-				<artifactId>cleartk-util</artifactId>
-				<version>0.8.1</version>
+				<artifactId>cleartk-release</artifactId>
+				<version>1.2.0</version>
+				<type>pom</type>
+				<scope>import</scope>
 			</dependency>
 			<dependency>
 				<groupId>args4j</groupId>



Mime
View raw message