You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2024/08/02 19:46:22 UTC
(ctakes) branch main updated: -final- pom dependency updates. ytex updates, but leaving much out for future removal. Replace code-built pipelines with pipers for dependency management.
This is an automated email from the ASF dual-hosted git repository.
seanfinan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ctakes.git
The following commit(s) were added to refs/heads/main by this push:
new 9a17ddb -final- pom dependency updates. ytex updates, but leaving much out for future removal. Replace code-built pipelines with pipers for dependency management.
9a17ddb is described below
commit 9a17ddb1de50437194f6bb3037532833550da8f9
Author: Sean Finan <se...@childrens.harvard.edu>
AuthorDate: Fri Aug 2 15:46:09 2024 -0400
-final- pom dependency updates.
ytex updates, but leaving much out for future removal.
Replace code-built pipelines with pipers for dependency management.
---
ctakes-assertion/pom.xml | 80 ++---
.../assertion/pipelines/PreprocessingPipeline.java | 46 ++-
ctakes-chunker/pom.xml | 2 +-
ctakes-clinical-pipeline/pom.xml | 20 +-
ctakes-core/pom.xml | 58 +--
.../coreference/data/PrintMimicMarkables.java | 56 ++-
ctakes-dependency-parser/pom.xml | 11 +-
ctakes-dictionary-lookup/pom.xml | 8 +
.../lookup/lucene/LuceneDictionaryImpl.java | 1 -
ctakes-examples/pom.xml | 8 +
ctakes-fhir/pom.xml | 4 +
ctakes-gui/pom.xml | 11 +
ctakes-ne-contexts/pom.xml | 8 +-
.../apache/ctakes/necontexts/ContextAnnotator.java | 3 +-
ctakes-pos-tagger/pom.xml | 2 +-
ctakes-relation-extractor/pom.xml | 32 +-
.../ctakes/relationextractor/eval/CorpusXMI.java | 23 +-
.../ctakes/relationextractor/eval/DeepPheXMI.java | 392 ---------------------
.../eval/ModifierExtractorEvaluation.java | 18 +-
.../eval/RelationExtractorEvaluation.java | 18 +-
ctakes-side-effect/pom.xml | 8 +-
ctakes-smoking-status/pom.xml | 8 +-
ctakes-temporal/pom.xml | 59 +++-
.../ctakes/temporal/eval/Evaluation_ImplBase.java | 201 +++++------
.../TemporalExtractionPipeline_ImplBase.java | 92 +++--
.../temporal/ae/BackwardsTimeAnnotatorTest.java | 48 +--
.../ae/ContextualModalityAnnotatorTest.java | 73 ++--
.../ctakes/temporal/ae/EventAnnotatorTest.java | 49 +--
.../ae/EventEventRelationAnnotatorTest.java | 67 ++--
.../ae/EventTimeRelationAnnotatorTest.java | 67 ++--
.../ctakes/temporal/ae/TemporalTest_ImplBase.java | 35 +-
ctakes-utils/pom.xml | 28 +-
pom.xml | 56 ++-
33 files changed, 672 insertions(+), 920 deletions(-)
diff --git a/ctakes-assertion/pom.xml b/ctakes-assertion/pom.xml
index a9515d1..44e452b 100644
--- a/ctakes-assertion/pom.xml
+++ b/ctakes-assertion/pom.xml
@@ -43,23 +43,23 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-dependency-parser</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-context-tokenizer</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-chunker</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-context-tokenizer</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-chunker</artifactId>-->
+<!-- </dependency>-->
- <dependency>
- <groupId>org.cleartk</groupId>
- <artifactId>cleartk-ml-libsvm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.cleartk</groupId>
- <artifactId>cleartk-type-system</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.cleartk</groupId>-->
+<!-- <artifactId>cleartk-ml-libsvm</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>org.cleartk</groupId>-->
+<!-- <artifactId>cleartk-type-system</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml-opennlp-maxent</artifactId>
@@ -80,34 +80,34 @@
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-document-annotation</artifactId>
</dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
- <dependency>
- <groupId>org.scala-tools.sbinary</groupId>
- <artifactId>sbinary_2.9.0</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.springframework</groupId>-->
+<!-- <artifactId>spring-core</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>org.springframework</groupId>-->
+<!-- <artifactId>spring-context</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>com.fasterxml.jackson.core</groupId>-->
+<!-- <artifactId>jackson-databind</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>org.scala-tools.sbinary</groupId>-->
+<!-- <artifactId>sbinary_2.9.0</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml-liblinear</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.httpcomponents.client5</groupId>
- <artifactId>httpclient5</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.httpcomponents.client5</groupId>-->
+<!-- <artifactId>httpclient5</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>com.google.code.gson</groupId>-->
+<!-- <artifactId>gson</artifactId>-->
+<!-- </dependency>-->
</dependencies>
<build>
<plugins>
diff --git a/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/PreprocessingPipeline.java b/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/PreprocessingPipeline.java
index ebc60ad..a9217f1 100644
--- a/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/PreprocessingPipeline.java
+++ b/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/PreprocessingPipeline.java
@@ -18,15 +18,7 @@
*/
package org.apache.ctakes.assertion.pipelines;
-import org.apache.ctakes.constituency.parser.ae.ConstituencyParser;
-import org.apache.ctakes.context.tokenizer.ae.ContextDependentTokenizerAnnotator;
-import org.apache.ctakes.core.ae.SentenceDetector;
-import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
-import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.postagger.POSTagger;
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
-import org.apache.uima.fit.factory.AggregateBuilder;
import org.apache.uima.resource.ResourceInitializationException;
import java.net.MalformedURLException;
@@ -34,25 +26,28 @@ import java.net.MalformedURLException;
//import org.apache.ctakes.lvg.ae.LvgAnnotator;
/**
+ * @deprecated Use a piper or a PipelineBuilder within your own code. This required unnecessary dependencies.
* Meant to replace the XML descriptors in the preprocessing pipeline, making it easier
* to access with API calls from outside projects that want to have the same preprocessing
* workflow as the standard training scripts.
*/
+@Deprecated
public class PreprocessingPipeline {
// This method gives a UimaFit version of the preprocessing pipeline that
// is otherwise in an xml descriptor file:
public static AnalysisEngineDescription getPreprocessingDescription() throws ResourceInitializationException, MalformedURLException {
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
- builder.add(SentenceDetector.createAnnotatorDescription());
- builder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
-// builder.add(LvgAnnotator.createAnnotatorDescription());
- builder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
- builder.add(POSTagger.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
- builder.add(ConstituencyParser.createAnnotatorDescription());
+ throw new ResourceInitializationException( new Exception( "This class has been deprecated." ) );
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
+// builder.add(SentenceDetector.createAnnotatorDescription());
+// builder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
+//// builder.add(LvgAnnotator.createAnnotatorDescription());
+// builder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
+// builder.add(POSTagger.createAnnotatorDescription());
+// builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+// builder.add(ConstituencyParser.createAnnotatorDescription());
- return builder.createAggregateDescription();
+// return builder.createAggregateDescription();
}
// This method is more appropriate for preprocessing of texts for which
@@ -60,12 +55,13 @@ public class PreprocessingPipeline {
// from the domains which trained those models, or perhaps have another
// language.
public static AnalysisEngineDescription getTokenPreprocessingDescription() throws ResourceInitializationException, MalformedURLException {
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
- builder.add(SentenceDetector.createAnnotatorDescription());
- builder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
- builder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
- builder.add(POSTagger.createAnnotatorDescription());
- return builder.createAggregateDescription();
+ throw new ResourceInitializationException( new Exception( "This class has been deprecated." ) );
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
+// builder.add(SentenceDetector.createAnnotatorDescription());
+// builder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
+// builder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
+// builder.add(POSTagger.createAnnotatorDescription());
+// return builder.createAggregateDescription();
}
}
diff --git a/ctakes-chunker/pom.xml b/ctakes-chunker/pom.xml
index 7df751c..c9d4156 100644
--- a/ctakes-chunker/pom.xml
+++ b/ctakes-chunker/pom.xml
@@ -37,7 +37,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-pos-tagger</artifactId>
+ <artifactId>ctakes-core</artifactId>
</dependency>
</dependencies>
<build>
diff --git a/ctakes-clinical-pipeline/pom.xml b/ctakes-clinical-pipeline/pom.xml
index 9b6d72a..b384a21 100644
--- a/ctakes-clinical-pipeline/pom.xml
+++ b/ctakes-clinical-pipeline/pom.xml
@@ -25,21 +25,33 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-dictionary-lookup-fast</artifactId>
</dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-preprocessor</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-preprocessor</artifactId>
+ <artifactId>ctakes-lvg</artifactId>
</dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-ne-contexts</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-lvg</artifactId>
+ <artifactId>ctakes-assertion</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-ne-contexts</artifactId>
+ <artifactId>ctakes-context-tokenizer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-assertion</artifactId>
+ <artifactId>ctakes-pos-tagger</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-chunker</artifactId>
</dependency>
</dependencies>
</project>
diff --git a/ctakes-core/pom.xml b/ctakes-core/pom.xml
index 68ca0a4..24469e6 100644
--- a/ctakes-core/pom.xml
+++ b/ctakes-core/pom.xml
@@ -39,32 +39,40 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-utils</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- </dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-type-system</artifactId>
</dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.logging.log4j</groupId>-->
+<!-- <artifactId>log4j-api</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>org.apache.logging.log4j</groupId>-->
+<!-- <artifactId>log4j-core</artifactId>-->
+<!-- </dependency>-->
+
<dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
</dependency>
+<!-- <dependency>-->
+<!-- <groupId>xerces</groupId>-->
+<!-- <artifactId>xercesImpl</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>commons-io</groupId>-->
+<!-- <artifactId>commons-io</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
</dependency>
- <dependency>
- <groupId>org.cleartk</groupId>
- <artifactId>cleartk-util</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.cleartk</groupId>-->
+<!-- <artifactId>cleartk-util</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml</artifactId>
@@ -77,10 +85,10 @@
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-tools</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.opennlp</groupId>
- <artifactId>opennlp-maxent</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.opennlp</groupId>-->
+<!-- <artifactId>opennlp-maxent</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>edu.mit.findstruct</groupId>
<artifactId>findstructapi</artifactId>
@@ -98,10 +106,10 @@
<groupId>com.lexicalscope.jewelcli</groupId>
<artifactId>jewelcli</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.uima</groupId>
- <artifactId>uimafit-core</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.uima</groupId>-->
+<!-- <artifactId>uimafit-core</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimafit-cpe</artifactId>
diff --git a/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/data/PrintMimicMarkables.java b/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/data/PrintMimicMarkables.java
index a0fdfe9..c1e7e86 100644
--- a/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/data/PrintMimicMarkables.java
+++ b/ctakes-coreference/src/main/java/org/apache/ctakes/coreference/data/PrintMimicMarkables.java
@@ -18,15 +18,7 @@
*/
package org.apache.ctakes.coreference.data;
-import org.apache.ctakes.constituency.parser.ae.ConstituencyParser;
-import org.apache.ctakes.context.tokenizer.ae.ContextDependentTokenizerAnnotator;
-import org.apache.ctakes.core.ae.SentenceDetectorAnnotatorBIO;
-import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
-import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
import org.apache.ctakes.core.cr.LuceneCollectionReader;
-import org.apache.ctakes.coreference.ae.DeterministicMarkableAnnotator;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.postagger.POSTagger;
import org.apache.ctakes.typesystem.type.syntax.BaseToken;
import org.apache.ctakes.typesystem.type.textsem.Markable;
import org.apache.uima.UIMAException;
@@ -137,28 +129,30 @@ public class PrintMimicMarkables {
}
public static AnalysisEngineDescription getMarkableExtractorDescription() throws ResourceInitializationException{
- AggregateBuilder aggregateBuilder = new AggregateBuilder();
-
- aggregateBuilder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
- aggregateBuilder.add(SentenceDetectorAnnotatorBIO.getDescription());
-
- // identify tokens
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( TokenizerAnnotatorPTB.class ) );
- // merge some tokens
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ContextDependentTokenizerAnnotator.class ) );
-
- // identify part-of-speech tags
- aggregateBuilder.add( POSTagger.createAnnotatorDescription());
-
- // add dependency parser
- aggregateBuilder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );
-
- // add ctakes constituency parses to system view
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ConstituencyParser.class,
- ConstituencyParser.PARAM_MODEL_FILENAME,
- "org/apache/ctakes/constituency/parser/models/thyme.bin" ) );
-
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(DeterministicMarkableAnnotator.class));
- return aggregateBuilder.createAggregateDescription();
+ throw new ResourceInitializationException( new Exception( "Use piper files when building pipelines," +
+ " otherwise modules and their dependencies are unnecessarily added." ) );
+// AggregateBuilder aggregateBuilder = new AggregateBuilder();
+//
+// aggregateBuilder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
+// aggregateBuilder.add(SentenceDetectorAnnotatorBIO.getDescription());
+//
+// // identify tokens
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( TokenizerAnnotatorPTB.class ) );
+// // merge some tokens
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ContextDependentTokenizerAnnotator.class ) );
+//
+// // identify part-of-speech tags
+// aggregateBuilder.add( POSTagger.createAnnotatorDescription());
+//
+// // add dependency parser
+// aggregateBuilder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );
+//
+// // add ctakes constituency parses to system view
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ConstituencyParser.class,
+// ConstituencyParser.PARAM_MODEL_FILENAME,
+// "org/apache/ctakes/constituency/parser/models/thyme.bin" ) );
+//
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(DeterministicMarkableAnnotator.class));
+// return aggregateBuilder.createAggregateDescription();
}
}
diff --git a/ctakes-dependency-parser/pom.xml b/ctakes-dependency-parser/pom.xml
index e547b9a..d0766aa 100644
--- a/ctakes-dependency-parser/pom.xml
+++ b/ctakes-dependency-parser/pom.xml
@@ -46,7 +46,16 @@
-->
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-pos-tagger</artifactId>
+ <artifactId>ctakes-core</artifactId>
+ </dependency>
+ <!-- Clearnlp uses log4j v1. Add the log4j bridge. -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-1.2-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.clearnlp</groupId>
+ <artifactId>clearnlp</artifactId>
</dependency>
<dependency>
<groupId>args4j</groupId>
diff --git a/ctakes-dictionary-lookup/pom.xml b/ctakes-dictionary-lookup/pom.xml
index 9da8928..bb8a322 100644
--- a/ctakes-dictionary-lookup/pom.xml
+++ b/ctakes-dictionary-lookup/pom.xml
@@ -52,6 +52,14 @@
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-queries</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-analyzers-common</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/lucene/LuceneDictionaryImpl.java b/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/lucene/LuceneDictionaryImpl.java
index 76bf937..f05542b 100644
--- a/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/lucene/LuceneDictionaryImpl.java
+++ b/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/lucene/LuceneDictionaryImpl.java
@@ -30,7 +30,6 @@ import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParserBase;
import org.apache.lucene.search.*;
-import org.apache.lucene.util.Version;
import java.io.IOException;
import java.util.Collection;
diff --git a/ctakes-examples/pom.xml b/ctakes-examples/pom.xml
index 1b32e61..be1cf10 100644
--- a/ctakes-examples/pom.xml
+++ b/ctakes-examples/pom.xml
@@ -55,6 +55,14 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-smoking-status</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-pos-tagger</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-dictionary-lookup-fast</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimafit-cpe</artifactId>
diff --git a/ctakes-fhir/pom.xml b/ctakes-fhir/pom.xml
index 18f0001..7459841 100644
--- a/ctakes-fhir/pom.xml
+++ b/ctakes-fhir/pom.xml
@@ -38,6 +38,10 @@
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu3</artifactId>
</dependency>
+ <dependency>
+ <groupId>ca.uhn.hapi.fhir</groupId>
+ <artifactId>org.hl7.fhir.dstu3</artifactId>
+ </dependency>
</dependencies>
<build>
</build>
diff --git a/ctakes-gui/pom.xml b/ctakes-gui/pom.xml
index dc49c0a..5c6dd67 100644
--- a/ctakes-gui/pom.xml
+++ b/ctakes-gui/pom.xml
@@ -26,6 +26,17 @@
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
</dependency>
+
+ <!-- TODO: For now keep this code here until LoggerPanel can be refactored for Logback (or other). -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+
</dependencies>
</project>
diff --git a/ctakes-ne-contexts/pom.xml b/ctakes-ne-contexts/pom.xml
index 81caeb9..4d86891 100644
--- a/ctakes-ne-contexts/pom.xml
+++ b/ctakes-ne-contexts/pom.xml
@@ -33,9 +33,9 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-core</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.uima</groupId>
- <artifactId>uimaj-document-annotation</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.uima</groupId>-->
+<!-- <artifactId>uimaj-document-annotation</artifactId>-->
+<!-- </dependency>-->
</dependencies>
</project>
diff --git a/ctakes-ne-contexts/src/main/java/org/apache/ctakes/necontexts/ContextAnnotator.java b/ctakes-ne-contexts/src/main/java/org/apache/ctakes/necontexts/ContextAnnotator.java
index 00658ca..2aa3d89 100644
--- a/ctakes-ne-contexts/src/main/java/org/apache/ctakes/necontexts/ContextAnnotator.java
+++ b/ctakes-ne-contexts/src/main/java/org/apache/ctakes/necontexts/ContextAnnotator.java
@@ -33,7 +33,6 @@ import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.tcas.Annotation;
-import org.apache.uima.jcas.tcas.DocumentAnnotation;
import org.apache.uima.resource.ResourceInitializationException;
import java.util.ArrayList;
@@ -96,7 +95,7 @@ public class ContextAnnotator extends org.apache.uima.fit.component.JCasAnnotato
* <li>...</li>
* </ul>
*
- * @see DocumentAnnotation
+// * @see DocumentAnnotation
// * @see edu.mayo.bmi.common.type.Sentence
// * @see edu.mayo.bmi.common.type.Segment
*
diff --git a/ctakes-pos-tagger/pom.xml b/ctakes-pos-tagger/pom.xml
index 31ee033..42c0f07 100644
--- a/ctakes-pos-tagger/pom.xml
+++ b/ctakes-pos-tagger/pom.xml
@@ -39,7 +39,7 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-core</artifactId>
</dependency>
- <!-- Clearnlp uses log4j v1. Add the log4j bridge. -->
+ <!-- Clearnlp uses log4j v1. Add the log4j bridge for it. -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
diff --git a/ctakes-relation-extractor/pom.xml b/ctakes-relation-extractor/pom.xml
index d27e1a9..bcd6a35 100644
--- a/ctakes-relation-extractor/pom.xml
+++ b/ctakes-relation-extractor/pom.xml
@@ -35,16 +35,42 @@
<artifactId>ctakes-relation-extractor-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
- <!-- Clinical Pipeline contains ctakes modules that are needed. -->
- <!-- Is Clinical Pipeline the best dependency? -->
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-clinical-pipeline</artifactId>
+ <artifactId>ctakes-constituency-parser</artifactId>
+ </dependency>
+
+<!-- <dependency>-->
+<!-- <groupId>org.cleartk</groupId>-->
+<!-- <artifactId>cleartk-ml-opennlp-maxent</artifactId>-->
+<!-- </dependency>-->
+ <dependency>
+ <groupId>org.cleartk</groupId>
+ <artifactId>cleartk-ml-liblinear</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.cleartk</groupId>
+ <artifactId>cleartk-util</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.cleartk</groupId>
+ <artifactId>cleartk-eval</artifactId>
+ </dependency>
+
+ <!-- Clinical Pipeline contains ctakes modules that are needed. -->
+ <!-- Is Clinical Pipeline the best dependency? -->
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-clinical-pipeline</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>edu.mit</groupId>
<artifactId>jwi</artifactId>
</dependency>
+ <dependency>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/CorpusXMI.java b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/CorpusXMI.java
index 35089a5..344ed08 100644
--- a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/CorpusXMI.java
+++ b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/CorpusXMI.java
@@ -35,7 +35,8 @@ import java.util.List;
* Created by tmill on 1/31/17.
*/
public abstract class CorpusXMI {
- public enum Corpus {SHARP, SHARP_RELEASE, DeepPhe}
+// public enum Corpus {SHARP, SHARP_RELEASE, DeepPhe}
+ public enum Corpus {SHARP, SHARP_RELEASE}
public enum EvaluateOn {
TRAIN, DEV, TEST, OTHER
@@ -60,8 +61,8 @@ public abstract class CorpusXMI {
trainFiles = SHARPXMI.getTrainTextFiles(corpusDirectory);
} else if (trainCorpus == Corpus.SHARP_RELEASE) {
trainFiles = SHARPXMI.getTrainTextFilesFromCorpus(corpusDirectory);
- } else if (trainCorpus == Corpus.DeepPhe) {
- trainFiles = DeepPheXMI.getTrainTextFiles(corpusDirectory);
+// } else if (trainCorpus == Corpus.DeepPhe) {
+// trainFiles = DeepPheXMI.getTrainTextFiles(corpusDirectory);
} else {
throw new RuntimeException("Unrecognized train corpus option: " + trainCorpus);
}
@@ -73,8 +74,8 @@ public abstract class CorpusXMI {
trainFiles.addAll(SHARPXMI.getDevTextFiles(corpusDirectory));
} else if (trainCorpus == Corpus.SHARP_RELEASE) {
trainFiles.addAll(SHARPXMI.getTrainTextFilesFromCorpus(corpusDirectory));
- } else if (trainCorpus == Corpus.DeepPhe) {
- trainFiles.addAll(DeepPheXMI.getTrainTextFiles(corpusDirectory));
+// } else if (trainCorpus == Corpus.DeepPhe) {
+// trainFiles.addAll(DeepPheXMI.getTrainTextFiles(corpusDirectory));
} else {
throw new RuntimeException("Unrecognized train corpus option: " + trainCorpus);
}
@@ -91,16 +92,16 @@ public abstract class CorpusXMI {
testFiles = SHARPXMI.getTrainTextFiles(corpusDirectory);
} else if (testCorpus == CorpusXMI.Corpus.SHARP_RELEASE) {
testFiles = SHARPXMI.getTrainTextFilesFromCorpus(corpusDirectory);
- } else if (testCorpus == CorpusXMI.Corpus.DeepPhe) {
- testFiles = DeepPheXMI.getTrainTextFiles(corpusDirectory);
+// } else if (testCorpus == CorpusXMI.Corpus.DeepPhe) {
+// testFiles = DeepPheXMI.getTrainTextFiles(corpusDirectory);
}
} else if (split == CorpusXMI.EvaluateOn.DEV) {
if (testCorpus == CorpusXMI.Corpus.SHARP) {
testFiles = SHARPXMI.getDevTextFiles(corpusDirectory);
} else if (testCorpus == Corpus.SHARP_RELEASE) {
testFiles = SHARPXMI.getDevTextFilesFromCorpus(corpusDirectory);
- } else if (testCorpus == CorpusXMI.Corpus.DeepPhe) {
- testFiles = DeepPheXMI.getDevTextFiles(corpusDirectory);
+// } else if (testCorpus == CorpusXMI.Corpus.DeepPhe) {
+// testFiles = DeepPheXMI.getDevTextFiles(corpusDirectory);
}
} else if (split == CorpusXMI.EvaluateOn.TEST) {
// find the test set files:
@@ -108,8 +109,8 @@ public abstract class CorpusXMI {
testFiles = SHARPXMI.getTestTextFiles(corpusDirectory);
} else if (testCorpus == Corpus.SHARP_RELEASE) {
testFiles = SHARPXMI.getTestTextFilesFromCorpus(corpusDirectory);
- } else if (testCorpus == CorpusXMI.Corpus.DeepPhe) {
- testFiles = DeepPheXMI.getTestTextFiles(corpusDirectory);
+// } else if (testCorpus == CorpusXMI.Corpus.DeepPhe) {
+// testFiles = DeepPheXMI.getTestTextFiles(corpusDirectory);
}
}
return testFiles;
diff --git a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/DeepPheXMI.java b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/DeepPheXMI.java
deleted file mode 100644
index 26c4985..0000000
--- a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/DeepPheXMI.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ctakes.relationextractor.eval;
-
-import com.google.common.collect.Sets;
-import org.apache.ctakes.chunker.ae.Chunker;
-import org.apache.ctakes.chunker.ae.adjuster.ChunkAdjuster;
-import org.apache.ctakes.constituency.parser.ae.ConstituencyParser;
-import org.apache.ctakes.context.tokenizer.ae.ContextDependentTokenizerAnnotator;
-import org.apache.ctakes.core.ae.SentenceDetectorAnnotatorBIO;
-import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
-import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
-import org.apache.ctakes.core.util.doc.DocIdUtil;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator;
-import org.apache.ctakes.lvg.ae.LvgAnnotator;
-import org.apache.ctakes.postagger.POSTagger;
-import org.apache.ctakes.typesystem.type.constants.CONST;
-import org.apache.ctakes.typesystem.type.relation.LocationOfTextRelation;
-import org.apache.ctakes.typesystem.type.relation.RelationArgument;
-import org.apache.ctakes.typesystem.type.textsem.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.uima.analysis_engine.AnalysisEngineDescription;
-import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
-import org.apache.uima.cas.CAS;
-import org.apache.uima.cas.impl.XmiCasSerializer;
-import org.apache.uima.collection.CollectionReader;
-import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
-import org.apache.uima.fit.component.ViewCreatorAnnotator;
-import org.apache.uima.fit.descriptor.ConfigurationParameter;
-import org.apache.uima.fit.factory.AggregateBuilder;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
-import org.apache.uima.fit.pipeline.JCasIterator;
-import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.tcas.Annotation;
-import org.apache.uima.resource.ResourceInitializationException;
-import org.apache.uima.util.XMLSerializer;
-import org.cleartk.util.ViewUriUtil;
-import org.cleartk.util.ae.UriToDocumentTextAnnotator;
-import org.cleartk.util.cr.UriCollectionReader;
-import org.jdom2.Element;
-import org.jdom2.JDOMException;
-import org.jdom2.input.SAXBuilder;
-import org.xml.sax.ContentHandler;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Created by tmill on 1/24/17.
- */
-public class DeepPheXMI extends CorpusXMI {
-
- private static Pattern dirPatt = Pattern.compile("patient(\\d+)_report(\\d+)_(.*)");
- private static Matcher matcher = null;
-
- // These are the splits for the breast cancer patient set.
- // See here: https://healthnlp.hms.harvard.edu/cancer/wiki/index.php/Main_Page#DeepPhe_Gold_Set
- public final static Set<Integer> trainPatients = Sets.newHashSet(3, 11, 92, 93);
- public final static Set<Integer> devPatients = Sets.newHashSet(2, 21);
- public final static Set<Integer> testPatients = Sets.newHashSet(1, 16);
-
- // TODO - much of this can be encapsulated in the parent class and just pass it the description for the corpus reader.
- public static void generateXMI(File xmiDirectory, File anaforaInputDirectory) throws Exception {
- // if necessary, write the XMIs first
- if ( !xmiDirectory.exists() ) {
- xmiDirectory.mkdirs();
- }
-
- List<File> files = new ArrayList<>();
- files.addAll(getTrainTextFiles(anaforaInputDirectory));
- files.addAll(getDevTextFiles(anaforaInputDirectory));
- files.addAll(getTestTextFiles(anaforaInputDirectory));
-
- CollectionReader reader = UriCollectionReader.getCollectionReaderFromFiles(files);
- AggregateBuilder builder = new AggregateBuilder();
- builder.add( UriToDocumentTextAnnotator.getDescription() );
-
- builder.add( getDeepPhePreprocessingPipeline() );
- builder.add( AnalysisEngineFactory.createEngineDescription(
- ViewCreatorAnnotator.class,
- ViewCreatorAnnotator.PARAM_VIEW_NAME,
- GOLD_VIEW_NAME ) );
- builder.add( AnalysisEngineFactory.createEngineDescription( CopyDocumentTextToGoldView.class ) );
- builder.add(
- AnalysisEngineFactory.createEngineDescription( DocumentIDAnnotator.class ),
- CAS.NAME_DEFAULT_SOFA,
- GOLD_VIEW_NAME );
- builder.add(
- AnalysisEngineFactory.createEngineDescription( DeepPheAnaforaXMLReader.getDescription(anaforaInputDirectory) ),
- CAS.NAME_DEFAULT_SOFA,
- GOLD_VIEW_NAME );
-
- // write out an XMI for each file
- for (Iterator<JCas> casIter = new JCasIterator( reader, builder.createAggregate() ); casIter.hasNext(); ) {
- JCas jCas = casIter.next();
- JCas goldView = jCas.getView(GOLD_VIEW_NAME);
- String documentID = DocIdUtil.getDocumentID(goldView);
- if (documentID == null) {//|| documentID.equals( DocumentIDAnnotationUtil.NO_DOCUMENT_ID ) ) {
- throw new IllegalArgumentException("No documentID for CAS:\n" + jCas);
- }
- File outFile = toXMIFile(xmiDirectory, new File(documentID));
- FileOutputStream stream = new FileOutputStream(outFile);
- ContentHandler handler = new XMLSerializer(stream).getContentHandler();
- new XmiCasSerializer(jCas.getTypeSystem()).serialize(jCas.getCas(), handler);
- stream.close();
- }
- }
-
- public static List<File> getTrainTextFiles(File anaforaDirectory) {
- return getSetTextFiles(anaforaDirectory, trainPatients);
- }
-
- public static List<File> getDevTextFiles(File anaforaDirectory){
- return getSetTextFiles(anaforaDirectory, devPatients);
- }
-
- public static List<File> getTestTextFiles(File anaforaDirectory){
- return getSetTextFiles(anaforaDirectory, testPatients);
- }
-
- private static List<File> getSetTextFiles(File anaforaDirectory, Set<Integer> setToUse){
- List<File> files = new ArrayList<>();
-
- for(File file : anaforaDirectory.listFiles()){
- if(file.isDirectory()){
- // Anafora files are organized into directories per annotation file.
- matcher = dirPatt.matcher(file.getName());
- if(matcher.matches()){
- int patientId = Integer.parseInt(matcher.group(1));
- if(setToUse.contains(patientId)){
- // The text file just replicates the last level of the directory path:
- files.add(new File(file, file.getName()));
- }
- }
- }
- }
- return files;
-
- }
-
- private static AnalysisEngineDescription getDeepPhePreprocessingPipeline() throws ResourceInitializationException, MalformedURLException {
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
- builder.add(SentenceDetectorAnnotatorBIO.getDescription());
- builder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
- builder.add(LvgAnnotator.createAnnotatorDescription());
- builder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
- builder.add(POSTagger.createAnnotatorDescription());
- builder.add(ConstituencyParser.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
- builder.add(Chunker.createAnnotatorDescription());
- builder.add(ChunkAdjuster.createAnnotatorDescription(new String[]{"NP", "NP"}, 1));
- builder.add(ChunkAdjuster.createAnnotatorDescription(new String[]{"NP", "PP", "NP"}, 2));
- builder.add(DefaultJCasTermAnnotator.createAnnotatorDescription());
-
- return builder.createAggregateDescription();
- }
-
-
-
- /**
- * Created by tmill on 2/7/17.
- */
- public static class DeepPheAnaforaXMLReader extends JCasAnnotator_ImplBase {
- private static Logger LOGGER = LoggerFactory.getLogger(DeepPheAnaforaXMLReader.class);
-
- public static final String PARAM_ANAFORA_DIRECTORY = "anaforaDirectory";
-
- @ConfigurationParameter(
- name = PARAM_ANAFORA_DIRECTORY,
- description = "root directory of the Anafora-annotated files, with one subdirectory for "
- + "each annotated file")
- private File anaforaDirectory;
-
- public static final String PARAM_ANAFORA_XML_SUFFIXES = "anaforaSuffixes";
- @ConfigurationParameter(
- name = PARAM_ANAFORA_XML_SUFFIXES,
- mandatory = false,
- description = "list of suffixes that might be added to a file name to identify the Anafora "
- + "XML annotations file; only the first suffix corresponding to a file will be used")
- private String[] anaforaXMLSuffixes = new String[]{".UmlsDeepPhe.dave.completed.xml"};
-
- public static AnalysisEngineDescription getDescription() throws ResourceInitializationException {
- return AnalysisEngineFactory.createEngineDescription(DeepPheAnaforaXMLReader.class);
- }
-
- public static AnalysisEngineDescription getDescription(File anaforaDirectory)
- throws ResourceInitializationException {
- return AnalysisEngineFactory.createEngineDescription(
- DeepPheAnaforaXMLReader.class,
- DeepPheAnaforaXMLReader.PARAM_ANAFORA_DIRECTORY,
- anaforaDirectory);
- }
-
- @Override
- public void process(JCas jCas) throws AnalysisEngineProcessException {
- File textFile = new File(ViewUriUtil.getURI(jCas));
- LOGGER.info("processing " + textFile);
-
- List<File> possibleXMLFiles = new ArrayList<>();
- for (String anaforaXMLSuffix : this.anaforaXMLSuffixes) {
- if (this.anaforaDirectory == null) {
- possibleXMLFiles.add(new File(textFile + anaforaXMLSuffix));
- } else {
- possibleXMLFiles.add(new File(textFile.getPath() + anaforaXMLSuffix));
- }
- }
-
- // find an Anafora XML file that actually exists
- File xmlFile = null;
- for (File possibleXMLFile : possibleXMLFiles) {
- if (possibleXMLFile.exists()) {
- xmlFile = possibleXMLFile;
- break;
- }
- }
- if (this.anaforaXMLSuffixes.length > 0 && xmlFile == null) {
- throw new IllegalArgumentException("no Anafora XML file found from " + possibleXMLFiles);
- }
-
- if (xmlFile != null) {
- processXmlFile(jCas, xmlFile);
- }
-
- }
-
- private static void processXmlFile(JCas jCas, File xmlFile) throws AnalysisEngineProcessException {
- // load the XML
- Element dataElem;
- try {
- dataElem = new SAXBuilder().build(xmlFile.toURI().toURL()).getRootElement();
- } catch (MalformedURLException e) {
- throw new AnalysisEngineProcessException(e);
- } catch (JDOMException e) {
- throw new AnalysisEngineProcessException(e);
- } catch (IOException e) {
- throw new AnalysisEngineProcessException(e);
- }
-
- List<String[]> delayedLocationRelations = new ArrayList<>();
- int docLen = jCas.getDocumentText().length();
-
- for (Element annotationsElem : dataElem.getChildren("annotations")) {
-
- Map<String, Annotation> idToAnnotation = new HashMap<>();
- for (Element entityElem : annotationsElem.getChildren("entity")) {
- String id = removeSingleChildText(entityElem, "id", null);
- Element spanElem = removeSingleChild(entityElem, "span", id);
- String type = removeSingleChildText(entityElem, "type", id);
- Element propertiesElem = removeSingleChild(entityElem, "properties", id);
-
- // UIMA doesn't support disjoint spans, so take the span enclosing
- // everything
- int begin = Integer.MAX_VALUE;
- int end = Integer.MIN_VALUE;
- for (String spanString : spanElem.getText().split(";")) {
- String[] beginEndStrings = spanString.split(",");
- if (beginEndStrings.length != 2) {
- error("span not of the format 'number,number'", id);
- }
- int spanBegin = Integer.parseInt(beginEndStrings[0]);
- int spanEnd = Integer.parseInt(beginEndStrings[1]);
- if (spanBegin < begin) {
- begin = spanBegin;
- }
- if (spanEnd > end) {
- end = spanEnd;
- }
- }
- if (begin < 0 || end >= docLen) {
- error("Illegal begin or end boundary", id);
- continue;
- }
-
- Annotation annotation = null;
- if (type.equals("Disease_Disorder")) {
- DiseaseDisorderMention dd = new DiseaseDisorderMention(jCas, begin, end);
-
- String bodyLocation = removeSingleChildText(propertiesElem, "body_location", id);
- if (bodyLocation != null && !bodyLocation.equals("")) {
- delayedLocationRelations.add(new String[]{id, bodyLocation});
- }
- annotation = dd;
- } else if (type.equals("Procedure")) {
- ProcedureMention proc = new ProcedureMention(jCas, begin, end);
- String bodyLocation = removeSingleChildText(propertiesElem, "body_location", id);
- if (bodyLocation != null && !bodyLocation.equals("")) {
- delayedLocationRelations.add(new String[]{id, bodyLocation});
- }
- annotation = proc;
- } else if (type.equals("Sign_symptom")) {
- SignSymptomMention ss = new SignSymptomMention(jCas, begin, end);
- String bodyLocation = removeSingleChildText(propertiesElem, "body_location", id);
- if (bodyLocation != null && !bodyLocation.equals("")) {
- delayedLocationRelations.add(new String[]{id, bodyLocation});
- }
- annotation = ss;
- } else if (type.equals("Metastasis")) {
- EventMention meta = new EventMention(jCas, begin, end);
- String bodyLocation = removeSingleChildText(propertiesElem, "body_location", id);
- if (bodyLocation != null && !bodyLocation.equals("")) {
- delayedLocationRelations.add(new String[]{id, bodyLocation});
- }
- annotation = meta;
- } else if (type.equals("Anatomical_site")) {
- AnatomicalSiteMention as = new AnatomicalSiteMention(jCas, begin, end);
- String code = removeSingleChildText(propertiesElem, "associatedCode", id);
- extractAttributeValues(propertiesElem, as, id);
- annotation = as;
- } else {
- LOGGER.info("This entity type is not being extracted yet!");
- }
-
- // match the annotation to it's ID for later use
- if (annotation != null) {
- annotation.addToIndexes();
- idToAnnotation.put(id, annotation);
- }
- }
-
- for (String[] args : delayedLocationRelations) {
- LocationOfTextRelation rel = new LocationOfTextRelation(jCas);
- rel.setCategory("location_of");
- RelationArgument arg1 = new RelationArgument(jCas);
- arg1.setArgument(idToAnnotation.get(args[0]));
- rel.setArg1(arg1);
- RelationArgument arg2 = new RelationArgument(jCas);
- arg2.setArgument(idToAnnotation.get(args[1]));
- rel.setArg2(arg2);
- rel.setDiscoveryTechnique(CONST.REL_DISCOVERY_TECH_GOLD_ANNOTATION);
- rel.addToIndexes();
- }
- }
- }
-
- private static void extractAttributeValues(Element propertiesElem, IdentifiedAnnotation annotation, String id) {
-
- }
-
- private static Element getSingleChild(Element elem, String elemName, String causeID) {
- List<Element> children = elem.getChildren(elemName);
- if (children.size() != 1) {
- error(String.format("not exactly one '%s' child", elemName), causeID);
- }
- return children.size() > 0 ? children.get(0) : null;
- }
-
- private static Element removeSingleChild(Element elem, String elemName, String causeID) {
- Element child = getSingleChild(elem, elemName, causeID);
- elem.removeChildren(elemName);
- return child;
- }
-
- private static String removeSingleChildText(Element elem, String elemName, String causeID) {
- Element child = getSingleChild(elem, elemName, causeID);
- String text = child.getText();
- if (text.isEmpty()) {
- error(String.format("an empty '%s' child", elemName), causeID);
- text = null;
- }
- elem.removeChildren(elemName);
- return text;
- }
-
- private static void error(String found, String id) {
- LOGGER.error(String.format("found %s in annotation with ID %s", found, id));
- }
- }
-}
diff --git a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
index d4874f0..dafb1b5 100644
--- a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
+++ b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/ModifierExtractorEvaluation.java
@@ -56,23 +56,23 @@ public class ModifierExtractorEvaluation extends RelationEvaluation_ImplBase {
boolean generateSharp = false, generateDeepPhe = false;
if (options.getTestCorpus() == CorpusXMI.Corpus.SHARP || options.getTestCorpus() == CorpusXMI.Corpus.SHARP_RELEASE) {
generateSharp = true;
- } else if (options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) {
- generateDeepPhe = true;
+// } else if (options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) {
+// generateDeepPhe = true;
}
for(CorpusXMI.Corpus corpus : options.getTrainCorpus()){
if(corpus == CorpusXMI.Corpus.SHARP_RELEASE || corpus == CorpusXMI.Corpus.SHARP){
generateSharp = true;
- }else if(corpus == CorpusXMI.Corpus.DeepPhe){
- generateDeepPhe = true;
+// }else if(corpus == CorpusXMI.Corpus.DeepPhe){
+// generateDeepPhe = true;
}
}
if(generateSharp){
SHARPXMI.generateXMI(options.getXMIDirectory(), options.getSharpCorpusDirectory(), options.getSharpBatchesDirectory());
}
- if(generateDeepPhe){
- DeepPheXMI.generateXMI(options.getXMIDirectory(), options.getDeepPheAnaforaDirectory());
- }
+// if(generateDeepPhe){
+// DeepPheXMI.generateXMI(options.getXMIDirectory(), options.getDeepPheAnaforaDirectory());
+// }
}
// determine the grid of parameters to search through
@@ -92,7 +92,7 @@ public class ModifierExtractorEvaluation extends RelationEvaluation_ImplBase {
File trainCorpusDirectory;
if(corpus == CorpusXMI.Corpus.SHARP) trainCorpusDirectory = options.getSharpBatchesDirectory();
else if(corpus == CorpusXMI.Corpus.SHARP_RELEASE) trainCorpusDirectory = options.getSharpCorpusDirectory();
- else if(corpus == CorpusXMI.Corpus.DeepPhe) trainCorpusDirectory = options.getDeepPheAnaforaDirectory();
+// else if(corpus == CorpusXMI.Corpus.DeepPhe) trainCorpusDirectory = options.getDeepPheAnaforaDirectory();
else{
throw new Exception("Train corpus not recognized: " + corpus);
}
@@ -102,7 +102,7 @@ public class ModifierExtractorEvaluation extends RelationEvaluation_ImplBase {
File testCorpusDirectory=null;
if(options.getTestCorpus() == CorpusXMI.Corpus.SHARP) testCorpusDirectory = options.getSharpBatchesDirectory();
else if(options.getTestCorpus() == CorpusXMI.Corpus.SHARP_RELEASE) testCorpusDirectory = options.getSharpCorpusDirectory();
- else if(options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) testCorpusDirectory = options.getDeepPheAnaforaDirectory();
+// else if(options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) testCorpusDirectory = options.getDeepPheAnaforaDirectory();
List<File> testFiles = CorpusXMI.getTestTextFiles(options.getTestCorpus(), options.getEvaluateOn(), testCorpusDirectory);
diff --git a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
index 624b424..1013489 100644
--- a/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
+++ b/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/eval/RelationExtractorEvaluation.java
@@ -175,23 +175,23 @@ public class RelationExtractorEvaluation extends RelationEvaluation_ImplBase {
boolean generateSharp = false, generateDeepPhe = false;
if (options.getTestCorpus() == CorpusXMI.Corpus.SHARP || options.getTestCorpus() == CorpusXMI.Corpus.SHARP_RELEASE) {
generateSharp = true;
- } else if (options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) {
- generateDeepPhe = true;
+// } else if (options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) {
+// generateDeepPhe = true;
}
for(CorpusXMI.Corpus corpus : options.getTrainCorpus()){
if(corpus == CorpusXMI.Corpus.SHARP_RELEASE || corpus == CorpusXMI.Corpus.SHARP){
generateSharp = true;
- }else if(corpus == CorpusXMI.Corpus.DeepPhe){
- generateDeepPhe = true;
+// }else if(corpus == CorpusXMI.Corpus.DeepPhe){
+// generateDeepPhe = true;
}
}
if(generateSharp){
SHARPXMI.generateXMI(options.getXMIDirectory(), options.getSharpCorpusDirectory(), options.getSharpBatchesDirectory());
}
- if(generateDeepPhe){
- DeepPheXMI.generateXMI(options.getXMIDirectory(), options.getDeepPheAnaforaDirectory());
- }
+// if(generateDeepPhe){
+// DeepPheXMI.generateXMI(options.getXMIDirectory(), options.getDeepPheAnaforaDirectory());
+// }
}
@@ -226,7 +226,7 @@ public class RelationExtractorEvaluation extends RelationEvaluation_ImplBase {
File trainCorpusDirectory;
if(corpus == CorpusXMI.Corpus.SHARP) trainCorpusDirectory = options.getSharpBatchesDirectory();
else if(corpus == CorpusXMI.Corpus.SHARP_RELEASE) trainCorpusDirectory = options.getSharpCorpusDirectory();
- else if(corpus == CorpusXMI.Corpus.DeepPhe) trainCorpusDirectory = options.getDeepPheAnaforaDirectory();
+// else if(corpus == CorpusXMI.Corpus.DeepPhe) trainCorpusDirectory = options.getDeepPheAnaforaDirectory();
else{
throw new Exception("Train corpus not recognized: " + corpus);
}
@@ -237,7 +237,7 @@ public class RelationExtractorEvaluation extends RelationEvaluation_ImplBase {
if(options.getTestCorpus() == CorpusXMI.Corpus.SHARP) testCorpusDirectory = options.getSharpBatchesDirectory();
else if(options.getTestCorpus() == CorpusXMI.Corpus.SHARP_RELEASE) testCorpusDirectory = options.getSharpCorpusDirectory();
- else if(options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) testCorpusDirectory = options.getDeepPheAnaforaDirectory();
+// else if(options.getTestCorpus() == CorpusXMI.Corpus.DeepPhe) testCorpusDirectory = options.getDeepPheAnaforaDirectory();
List<File> testFiles = CorpusXMI.toXMIFiles(options.getXMIDirectory(), CorpusXMI.getTestTextFiles(options.getTestCorpus(), options.getEvaluateOn(), testCorpusDirectory));
diff --git a/ctakes-side-effect/pom.xml b/ctakes-side-effect/pom.xml
index b20af70..60d7174 100644
--- a/ctakes-side-effect/pom.xml
+++ b/ctakes-side-effect/pom.xml
@@ -36,10 +36,10 @@
<artifactId>ctakes-side-effect-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-dictionary-lookup</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-dictionary-lookup</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-drug-ner</artifactId>
diff --git a/ctakes-smoking-status/pom.xml b/ctakes-smoking-status/pom.xml
index 4865a40..bab36a5 100644
--- a/ctakes-smoking-status/pom.xml
+++ b/ctakes-smoking-status/pom.xml
@@ -40,10 +40,10 @@
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-dictionary-lookup</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-drug-ner</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.ctakes</groupId>-->
+<!-- <artifactId>ctakes-drug-ner</artifactId>-->
+<!-- </dependency>-->
</dependencies>
<build>
<plugins>
diff --git a/ctakes-temporal/pom.xml b/ctakes-temporal/pom.xml
index f44e495..ce1cad9 100644
--- a/ctakes-temporal/pom.xml
+++ b/ctakes-temporal/pom.xml
@@ -36,19 +36,31 @@
<artifactId>ctakes-temporal-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
- <!-- Relation extractor uses clinical-pipeline. No need to redeclare all those dependencies. -->
<dependency>
<groupId>org.apache.ctakes</groupId>
<artifactId>ctakes-relation-extractor</artifactId>
</dependency>
+ <!-- Clearnlp uses log4j v1. Add the log4j bridge for it. -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-1.2-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.clearnlp</groupId>
+ <artifactId>clearnlp</artifactId>
+ </dependency>
<dependency>
<groupId>org.cleartk</groupId>
- <artifactId>cleartk-timeml</artifactId>
+ <artifactId>cleartk-ml-libsvm</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
- <artifactId>cleartk-ml-svmlight</artifactId>
+ <artifactId>cleartk-timeml</artifactId>
</dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.cleartk</groupId>-->
+<!-- <artifactId>cleartk-ml-svmlight</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml-tksvmlight</artifactId>
@@ -61,10 +73,10 @@
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml-crfsuite</artifactId>
</dependency>
- <dependency>
- <groupId>org.cleartk</groupId>
- <artifactId>cleartk-ml-mallet</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.cleartk</groupId>-->
+<!-- <artifactId>cleartk-ml-mallet</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.clulab</groupId>
<artifactId>timenorm_2.13</artifactId>
@@ -81,6 +93,39 @@
<groupId>com.rubiconproject.oss</groupId>
<artifactId>jchronic</artifactId>
</dependency>
+
+ <!-- Add test modules so that classes as available. When not testing we don't need these -->
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-pos-tagger</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-chunker</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-dependency-parser</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-context-tokenizer</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-dictionary-lookup-fast</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ctakes</groupId>
+ <artifactId>ctakes-assertion</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<!-- The below is all necessary to unpack the UMLS resources since they
diff --git a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
index 28a7507..deb7325 100644
--- a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
+++ b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
@@ -21,29 +21,14 @@ package org.apache.ctakes.temporal.eval;
import com.google.common.collect.Lists;
import com.google.common.io.CharStreams;
import com.lexicalscope.jewel.cli.Option;
-import org.apache.ctakes.chunker.ae.Chunker;
-import org.apache.ctakes.chunker.ae.DefaultChunkCreator;
-import org.apache.ctakes.chunker.ae.adjuster.ChunkAdjuster;
-import org.apache.ctakes.constituency.parser.ae.ConstituencyParser;
-import org.apache.ctakes.context.tokenizer.ae.ContextDependentTokenizerAnnotator;
-import org.apache.ctakes.core.ae.OverlapAnnotator;
-import org.apache.ctakes.core.ae.SentenceDetector;
-import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
import org.apache.ctakes.core.patient.PatientNoteStore;
import org.apache.ctakes.core.pipeline.PipeBitInfo;
-import org.apache.ctakes.core.resource.FileLocator;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator;
-import org.apache.ctakes.lvg.ae.LvgAnnotator;
-import org.apache.ctakes.postagger.POSTagger;
import org.apache.ctakes.temporal.ae.I2B2TemporalXMLReader;
import org.apache.ctakes.temporal.ae.THYMEAnaforaXMLReader;
import org.apache.ctakes.temporal.ae.THYMEKnowtatorXMLReader;
-import org.apache.ctakes.temporal.ae.THYMETreebankReader;
import org.apache.ctakes.temporal.duration.Utils;
import org.apache.ctakes.typesystem.type.constants.CONST;
import org.apache.ctakes.typesystem.type.relation.TemporalTextRelation;
-import org.apache.ctakes.typesystem.type.syntax.BaseToken;
import org.apache.ctakes.typesystem.type.syntax.Chunk;
import org.apache.ctakes.typesystem.type.syntax.TerminalTreebankNode;
import org.apache.ctakes.typesystem.type.syntax.TreebankNode;
@@ -53,7 +38,6 @@ import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
import org.apache.ctakes.typesystem.type.textsem.TimeMention;
import org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation;
import org.apache.ctakes.typesystem.type.textspan.Segment;
-import org.apache.ctakes.typesystem.type.textspan.Sentence;
import org.apache.ctakes.utils.struct.CounterMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -74,8 +58,6 @@ import org.apache.uima.fit.component.ViewTextCopierAnnotator;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.factory.AggregateBuilder;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
-import org.apache.uima.fit.factory.TypePrioritiesFactory;
-import org.apache.uima.fit.factory.TypeSystemDescriptionFactory;
import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
@@ -107,8 +89,6 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-//import org.apache.ctakes.core.cleartk.ae.SentenceDetectorAnnotator;
-//import org.threeten.bp.temporal.TemporalUnit;
public abstract class Evaluation_ImplBase<STATISTICS_TYPE> extends
org.cleartk.eval.Evaluation_ImplBase<Integer, STATISTICS_TYPE> {
@@ -527,96 +507,97 @@ org.cleartk.eval.Evaluation_ImplBase<Integer, STATISTICS_TYPE> {
}
protected AnalysisEngineDescription getLinguisticProcessingDescription() throws Exception{
- AggregateBuilder aggregateBuilder = new AggregateBuilder();
- // identify segments
- if(this.subcorpus == Subcorpus.DeepPhe){
- aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(PittHeaderAnnotator.class));
- }else{
- aggregateBuilder
- .add( AnalysisEngineFactory.createEngineDescription( SegmentsFromBracketedSectionTagsAnnotator.class ) );
- }
- // identify sentences
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
- SentenceDetector.class,
- SentenceDetector.SD_MODEL_FILE_PARAM,
- "org/apache/ctakes/core/models/sentdetect/sd-med-model.zip" ) );
- // aggregateBuilder.add(SentenceDetectorAnnotatorBIO.getDescription(FileLocator.locateFile("org/apache/ctakes/core/sentdetect/model.jar").getPath()));
-
- // identify tokens
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( TokenizerAnnotatorPTB.class ) );
- // merge some tokens
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ContextDependentTokenizerAnnotator.class ) );
-
- // identify part-of-speech tags
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
- POSTagger.class,
- TypeSystemDescriptionFactory.createTypeSystemDescription(),
- TypePrioritiesFactory.createTypePriorities( Segment.class, Sentence.class, BaseToken.class ),
- POSTagger.POS_MODEL_FILE_PARAM,
- "org/apache/ctakes/postagger/models/mayo-pos.zip" ) );
-
- // identify chunks
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
- Chunker.class,
- Chunker.CHUNKER_MODEL_FILE_PARAM,
- FileLocator.getFile( "org/apache/ctakes/chunker/models/chunker-model.zip" ),
- Chunker.CHUNKER_CREATOR_CLASS_PARAM,
- DefaultChunkCreator.class ) );
-
- // identify UMLS named entities
-
- // adjust NP in NP NP to span both
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
- ChunkAdjuster.class,
- ChunkAdjuster.PARAM_CHUNK_PATTERN,
- new String[] { "NP", "NP" },
- ChunkAdjuster.PARAM_EXTEND_TO_INCLUDE_TOKEN,
- 1 ) );
- // adjust NP in NP PP NP to span all three
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
- ChunkAdjuster.class,
- ChunkAdjuster.PARAM_CHUNK_PATTERN,
- new String[] { "NP", "PP", "NP" },
- ChunkAdjuster.PARAM_EXTEND_TO_INCLUDE_TOKEN,
- 2 ) );
- // add lookup windows for each NP
- aggregateBuilder
- .add( AnalysisEngineFactory.createEngineDescription( CopyNPChunksToLookupWindowAnnotations.class ) );
- // maximize lookup windows
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
- OverlapAnnotator.class,
- "A_ObjectClass",
- LookupWindowAnnotation.class,
- "B_ObjectClass",
- LookupWindowAnnotation.class,
- "OverlapType",
- "A_ENV_B",
- "ActionType",
- "DELETE",
- "DeleteAction",
- new String[] { "selector=B" } ) );
- // add UMLS on top of lookup windows
- aggregateBuilder.add( LvgAnnotator.createAnnotatorDescription() );
- aggregateBuilder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
-
- // add dependency parser
- aggregateBuilder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );
-
- // add semantic role labeler
-// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ClearNLPSemanticRoleLabelerAE.class ) );
-
- // add gold standard parses to gold view, and adjust gold view to correct a few annotation mis-steps
- if ( this.treebankDirectory != null ) {
- aggregateBuilder.add( THYMETreebankReader.getDescription( this.treebankDirectory ) );
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( TimexAnnotationCorrector.class ) );
- } else {
- // add ctakes constituency parses to system view
- aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ConstituencyParser.class,
- ConstituencyParser.PARAM_MODEL_FILENAME,
- "org/apache/ctakes/constituency/parser/models/thyme.bin" ) );
- }
-
- return aggregateBuilder.createAggregateDescription();
+ throw new Exception( "Use a piper file to build pipelines. This method adds many maven dependencies that aren't required by the actual module." );
+// AggregateBuilder aggregateBuilder = new AggregateBuilder();
+// // identify segments
+// if(this.subcorpus == Subcorpus.DeepPhe){
+// aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(PittHeaderAnnotator.class));
+// }else{
+// aggregateBuilder
+// .add( AnalysisEngineFactory.createEngineDescription( SegmentsFromBracketedSectionTagsAnnotator.class ) );
+// }
+// // identify sentences
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
+// SentenceDetector.class,
+// SentenceDetector.SD_MODEL_FILE_PARAM,
+// "org/apache/ctakes/core/models/sentdetect/sd-med-model.zip" ) );
+// // aggregateBuilder.add(SentenceDetectorAnnotatorBIO.getDescription(FileLocator.locateFile("org/apache/ctakes/core/sentdetect/model.jar").getPath()));
+//
+// // identify tokens
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( TokenizerAnnotatorPTB.class ) );
+// // merge some tokens
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ContextDependentTokenizerAnnotator.class ) );
+//
+// // identify part-of-speech tags
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
+// POSTagger.class,
+// TypeSystemDescriptionFactory.createTypeSystemDescription(),
+// TypePrioritiesFactory.createTypePriorities( Segment.class, Sentence.class, BaseToken.class ),
+// POSTagger.POS_MODEL_FILE_PARAM,
+// "org/apache/ctakes/postagger/models/mayo-pos.zip" ) );
+//
+// // identify chunks
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
+// Chunker.class,
+// Chunker.CHUNKER_MODEL_FILE_PARAM,
+// FileLocator.getFile( "org/apache/ctakes/chunker/models/chunker-model.zip" ),
+// Chunker.CHUNKER_CREATOR_CLASS_PARAM,
+// DefaultChunkCreator.class ) );
+//
+// // identify UMLS named entities
+//
+// // adjust NP in NP NP to span both
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
+// ChunkAdjuster.class,
+// ChunkAdjuster.PARAM_CHUNK_PATTERN,
+// new String[] { "NP", "NP" },
+// ChunkAdjuster.PARAM_EXTEND_TO_INCLUDE_TOKEN,
+// 1 ) );
+// // adjust NP in NP PP NP to span all three
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
+// ChunkAdjuster.class,
+// ChunkAdjuster.PARAM_CHUNK_PATTERN,
+// new String[] { "NP", "PP", "NP" },
+// ChunkAdjuster.PARAM_EXTEND_TO_INCLUDE_TOKEN,
+// 2 ) );
+// // add lookup windows for each NP
+// aggregateBuilder
+// .add( AnalysisEngineFactory.createEngineDescription( CopyNPChunksToLookupWindowAnnotations.class ) );
+// // maximize lookup windows
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription(
+// OverlapAnnotator.class,
+// "A_ObjectClass",
+// LookupWindowAnnotation.class,
+// "B_ObjectClass",
+// LookupWindowAnnotation.class,
+// "OverlapType",
+// "A_ENV_B",
+// "ActionType",
+// "DELETE",
+// "DeleteAction",
+// new String[] { "selector=B" } ) );
+// // add UMLS on top of lookup windows
+// aggregateBuilder.add( LvgAnnotator.createAnnotatorDescription() );
+// aggregateBuilder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
+//
+// // add dependency parser
+// aggregateBuilder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );
+//
+// // add semantic role labeler
+//// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ClearNLPSemanticRoleLabelerAE.class ) );
+//
+// // add gold standard parses to gold view, and adjust gold view to correct a few annotation mis-steps
+// if ( this.treebankDirectory != null ) {
+// aggregateBuilder.add( THYMETreebankReader.getDescription( this.treebankDirectory ) );
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( TimexAnnotationCorrector.class ) );
+// } else {
+// // add ctakes constituency parses to system view
+// aggregateBuilder.add( AnalysisEngineFactory.createEngineDescription( ConstituencyParser.class,
+// ConstituencyParser.PARAM_MODEL_FILENAME,
+// "org/apache/ctakes/constituency/parser/models/thyme.bin" ) );
+// }
+//
+// return aggregateBuilder.createAggregateDescription();
}
public static <T extends Annotation> List<T> selectExact( JCas jCas, Class<T> annotationClass, Segment segment ) {
diff --git a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java
index e8968a1..f69be79 100644
--- a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java
+++ b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java
@@ -19,19 +19,8 @@
package org.apache.ctakes.temporal.pipelines;
import com.lexicalscope.jewel.cli.Option;
-import org.apache.ctakes.chunker.ae.Chunker;
-import org.apache.ctakes.constituency.parser.ae.ConstituencyParser;
-import org.apache.ctakes.context.tokenizer.ae.ContextDependentTokenizerAnnotator;
-import org.apache.ctakes.core.ae.SentenceDetector;
-import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
-import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
import org.apache.ctakes.core.cc.FileTreeXmiWriter;
import org.apache.ctakes.core.config.ConfigParameterConstants;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
-import org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator;
-import org.apache.ctakes.lvg.ae.LvgAnnotator;
-import org.apache.ctakes.postagger.POSTagger;
import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.fit.factory.AggregateBuilder;
@@ -40,6 +29,11 @@ import org.apache.uima.resource.ResourceInitializationException;
import java.net.MalformedURLException;
+/**
+ * @deprecated Please use piper files (which do not require maven code dependencies)
+ * or a pipeline builder in your own project.
+ */
+@Deprecated
public abstract class TemporalExtractionPipeline_ImplBase {
public static interface Options {
@@ -59,40 +53,40 @@ public abstract class TemporalExtractionPipeline_ImplBase {
*/
protected static AggregateBuilder getPreprocessorAggregateBuilder()
throws Exception {
- AggregateBuilder aggregateBuilder = new AggregateBuilder();
- aggregateBuilder.add(getFastPipeline());
- // add semantic role labeler
- aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ClearNLPSemanticRoleLabelerAE.class));
- aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ConstituencyParser.class));
- return aggregateBuilder;
+ throw new Exception( "Deprecated. Please use piper files or your own pipeline builder." );
+// AggregateBuilder aggregateBuilder = new AggregateBuilder();
+// aggregateBuilder.add(getFastPipeline());
+// // add semantic role labeler
+// aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ClearNLPSemanticRoleLabelerAE.class));
+// aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ConstituencyParser.class));
+// return aggregateBuilder;
}
protected static AggregateBuilder getLightweightPreprocessorAggregateBuilder() throws Exception{
- AggregateBuilder aggregateBuilder = new AggregateBuilder();
-
- /** Consider using ClinicalPipelineFactory.getDefaultPipeline()
- *
- */
- // identify segments; use simple segment annotator on non-mayo notes
- // aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(SegmentsFromBracketedSectionTagsAnnotator.class));
-
- aggregateBuilder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
- aggregateBuilder.add(SentenceDetector.createAnnotatorDescription());
- aggregateBuilder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
- aggregateBuilder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
- aggregateBuilder.add(POSTagger.createAnnotatorDescription());
- aggregateBuilder.add(Chunker.createAnnotatorDescription());
- aggregateBuilder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
- aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ClearNLPSemanticRoleLabelerAE.class));
- aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ConstituencyParser.class));
-
- return aggregateBuilder;
+ throw new Exception( "Deprecated. Please use piper files or your own pipeline builder." );
+// AggregateBuilder aggregateBuilder = new AggregateBuilder();
+//
+// /** Consider using ClinicalPipelineFactory.getDefaultPipeline()
+// *
+// */
+// // identify segments; use simple segment annotator on non-mayo notes
+// // aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(SegmentsFromBracketedSectionTagsAnnotator.class));
+//
+// aggregateBuilder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
+// aggregateBuilder.add(SentenceDetector.createAnnotatorDescription());
+// aggregateBuilder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
+// aggregateBuilder.add(ContextDependentTokenizerAnnotator.createAnnotatorDescription());
+// aggregateBuilder.add(POSTagger.createAnnotatorDescription());
+// aggregateBuilder.add(Chunker.createAnnotatorDescription());
+// aggregateBuilder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+// aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ClearNLPSemanticRoleLabelerAE.class));
+// aggregateBuilder.add(AnalysisEngineFactory.createEngineDescription(ConstituencyParser.class));
+//
+// return aggregateBuilder;
}
protected static AnalysisEngine getXMIWriter(String outputDirectory) throws ResourceInitializationException{
return AnalysisEngineFactory.createEngine(
-// XmiWriterCasConsumerCtakes.class,
-// XmiWriterCasConsumerCtakes.PARAM_OUTPUTDIR,
FileTreeXmiWriter.class,
ConfigParameterConstants.PARAM_OUTPUTDIR,
outputDirectory
@@ -100,15 +94,17 @@ public abstract class TemporalExtractionPipeline_ImplBase {
}
public static AnalysisEngineDescription getFastPipeline() throws ResourceInitializationException, MalformedURLException {
- AggregateBuilder builder = new AggregateBuilder();
- builder.add( SimpleSegmentAnnotator.createAnnotatorDescription() );
- builder.add( SentenceDetector.createAnnotatorDescription() );
- builder.add( TokenizerAnnotatorPTB.createAnnotatorDescription() );
- builder.add( LvgAnnotator.createAnnotatorDescription() );
- builder.add( ContextDependentTokenizerAnnotator.createAnnotatorDescription() );
- builder.add( POSTagger.createAnnotatorDescription() );
- builder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
- builder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );
- return builder.createAggregateDescription();
+ throw new ResourceInitializationException (
+ new Exception( "Deprecated. Please use piper files or your own pipeline builder." ) );
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add( SimpleSegmentAnnotator.createAnnotatorDescription() );
+// builder.add( SentenceDetector.createAnnotatorDescription() );
+// builder.add( TokenizerAnnotatorPTB.createAnnotatorDescription() );
+// builder.add( LvgAnnotator.createAnnotatorDescription() );
+// builder.add( ContextDependentTokenizerAnnotator.createAnnotatorDescription() );
+// builder.add( POSTagger.createAnnotatorDescription() );
+// builder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
+// builder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );
+// return builder.createAggregateDescription();
}
}
diff --git a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/BackwardsTimeAnnotatorTest.java b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/BackwardsTimeAnnotatorTest.java
index 98ab42a..acd9357 100644
--- a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/BackwardsTimeAnnotatorTest.java
+++ b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/BackwardsTimeAnnotatorTest.java
@@ -18,15 +18,12 @@
*/
package org.apache.ctakes.temporal.ae;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
+import org.apache.ctakes.core.pipeline.PiperFileReader;
import org.apache.ctakes.typesystem.type.textsem.TimeMention;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.uima.UIMAException;
-import org.apache.uima.fit.factory.AggregateBuilder;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.JCasFactory;
-import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.junit.Test;
@@ -45,30 +42,37 @@ public class BackwardsTimeAnnotatorTest extends TemporalTest_ImplBase {
@Test
public void testPipeline() throws UIMAException, IOException {
-
+ if ( !canUseUmlsDictionary() ) {
+ LOGGER.warn( "Running this test requires that UmlsKey is set in your environment." );
+ return;
+ }
String note = "The patient is a 55-year-old man referred by Dr. Good for recently diagnosed colorectal cancer. "
+ "The patient was well until 6 months ago, when he started having a little blood with stool.";
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText(note);
- // Get the default pipeline with umls dictionary lookup
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(getTokenProcessingPipeline());
- builder.add(AnalysisEngineFactory
- .createEngineDescription(org.apache.ctakes.temporal.eval.Evaluation_ImplBase.CopyNPChunksToLookupWindowAnnotations.class));
- builder.add(AnalysisEngineFactory
- .createEngineDescription(org.apache.ctakes.temporal.eval.Evaluation_ImplBase.RemoveEnclosedLookupWindows.class));
- // Commented out the Dictionary lookup for the test
- // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
- // needed
- // builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
-
- // Add BackwardsTimeAnnotator
- builder.add(BackwardsTimeAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
+ // Use piper files so that a module doesn't need to depend upon all of ctakes just to run a test.
+// // Get the default pipeline with umls dictionary lookup
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(getTokenProcessingPipeline());
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(org.apache.ctakes.temporal.eval.Evaluation_ImplBase.CopyNPChunksToLookupWindowAnnotations.class));
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(org.apache.ctakes.temporal.eval.Evaluation_ImplBase.RemoveEnclosedLookupWindows.class));
+// // Commented out the Dictionary lookup for the test
+// // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
+// // needed
+// // builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
+// builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+//
+// // Add BackwardsTimeAnnotator
+// builder.add(BackwardsTimeAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
+//
+// SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
- SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+ // Use piper files so that a module doesn't need to depend upon all of ctakes just to run a test.
+ new PiperFileReader( "DefaultTemporalPipeline" ).getBuilder().run( jcas );
Collection<TimeMention> mentions = JCasUtil.select(jcas,
TimeMention.class);
diff --git a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/ContextualModalityAnnotatorTest.java b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/ContextualModalityAnnotatorTest.java
index e0ac6c2..7c2e22a 100644
--- a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/ContextualModalityAnnotatorTest.java
+++ b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/ContextualModalityAnnotatorTest.java
@@ -18,17 +18,12 @@
*/
package org.apache.ctakes.temporal.ae;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.CopyNPChunksToLookupWindowAnnotations;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.RemoveEnclosedLookupWindows;
+import org.apache.ctakes.core.pipeline.PiperFileReader;
import org.apache.ctakes.typesystem.type.textsem.EventMention;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.uima.UIMAException;
-import org.apache.uima.fit.factory.AggregateBuilder;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.JCasFactory;
-import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.junit.Test;
@@ -44,42 +39,48 @@ public class ContextualModalityAnnotatorTest extends TemporalTest_ImplBase {
@Test
public void testPipeline() throws UIMAException, IOException {
-
+ if ( !canUseUmlsDictionary() ) {
+ LOGGER.warn( "Running this test requires that UmlsKey is set in your environment." );
+ return;
+ }
String note = "The patient is a 55-year-old man referred by Dr. Good for recently diagnosed colorectal cancer. "
+ "The patient was well till 6 months ago, when he started having a little blood with stool.";
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText(note);
- // Get the default pipeline with umls dictionary lookup
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(getTokenProcessingPipeline());
- builder.add(AnalysisEngineFactory
- .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
- builder.add(AnalysisEngineFactory
- .createEngineDescription(RemoveEnclosedLookupWindows.class));
- // Commented out the Dictionary lookup for the test
- // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
- // needed
- //builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
-
- // Add BackwardsTimeAnnotator
- builder.add(BackwardsTimeAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
- // Add EventAnnotator
- builder.add(EventAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
- // Add ContextualModalityAnnotator
- builder.add(ContextualModalityAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/contextualmodality/model.jar"));
-
- // Add DocTimeRelAnnotator
- builder.add(DocTimeRelAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/doctimerel/model.jar"));
+// // Get the default pipeline with umls dictionary lookup
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(getTokenProcessingPipeline());
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(RemoveEnclosedLookupWindows.class));
+// // Commented out the Dictionary lookup for the test
+// // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
+// // needed
+// //builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
+// builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+//
+// // Add BackwardsTimeAnnotator
+// builder.add(BackwardsTimeAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
+// // Add EventAnnotator
+// builder.add(EventAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
+// // Add ContextualModalityAnnotator
+// builder.add(ContextualModalityAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/contextualmodality/model.jar"));
+//
+// // Add DocTimeRelAnnotator
+// builder.add(DocTimeRelAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/doctimerel/model.jar"));
+//
+// //builder.createEngineDescription().toXML(new FileWriter("desc/analysis_engine/TemporalAggregateUMLSPipeline.xml"));
+//
+// SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
- //builder.createEngineDescription().toXML(new FileWriter("desc/analysis_engine/TemporalAggregateUMLSPipeline.xml"));
-
- SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+ // Use piper files so that a module doesn't need to depend upon all of ctakes just to run a test.
+ new PiperFileReader( "DefaultTemporalPipeline" ).getBuilder().run( jcas );
Collection<EventMention> mentions = JCasUtil.select(jcas,
EventMention.class);
diff --git a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventAnnotatorTest.java b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventAnnotatorTest.java
index 7370cf2..c10f060 100644
--- a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventAnnotatorTest.java
+++ b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventAnnotatorTest.java
@@ -18,17 +18,12 @@
*/
package org.apache.ctakes.temporal.ae;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.CopyNPChunksToLookupWindowAnnotations;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.RemoveEnclosedLookupWindows;
+import org.apache.ctakes.core.pipeline.PiperFileReader;
import org.apache.ctakes.typesystem.type.textsem.EventMention;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.uima.UIMAException;
-import org.apache.uima.fit.factory.AggregateBuilder;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.JCasFactory;
-import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.junit.Test;
@@ -47,30 +42,36 @@ public class EventAnnotatorTest extends TemporalTest_ImplBase {
@Test
public void testPipeline() throws UIMAException, IOException {
-
+ if ( !canUseUmlsDictionary() ) {
+ LOGGER.warn( "Running this test requires that UmlsKey is set in your environment." );
+ return;
+ }
String note = "The patient is a 55-year-old man referred by Dr. Good for recently diagnosed colorectal cancer. "
+ "The patient was well till 6 months ago, when he started having a little blood with stool.";
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText(note);
- // Get the default pipeline
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(getTokenProcessingPipeline());
- builder.add(AnalysisEngineFactory
- .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
- builder.add(AnalysisEngineFactory
- .createEngineDescription(RemoveEnclosedLookupWindows.class));
- // Commented out the Dictionary lookup for the test
- // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
- // needed
- // builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
-
- // Add EventAnnotator
- builder.add(EventAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
+// // Get the default pipeline
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(getTokenProcessingPipeline());
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(RemoveEnclosedLookupWindows.class));
+// // Commented out the Dictionary lookup for the test
+// // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
+// // needed
+// // builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
+// builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+//
+// // Add EventAnnotator
+// builder.add(EventAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
+//
+// SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
- SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+ // Use piper files so that a module doesn't need to depend upon all of ctakes just to run a test.
+ new PiperFileReader( "DefaultTemporalPipeline" ).getBuilder().run( jcas );
Collection<EventMention> mentions = JCasUtil.select(jcas,
EventMention.class);
diff --git a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotatorTest.java b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotatorTest.java
index f88f924..c4967b9 100644
--- a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotatorTest.java
+++ b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventEventRelationAnnotatorTest.java
@@ -19,9 +19,7 @@
package org.apache.ctakes.temporal.ae;
import com.google.common.collect.Lists;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.CopyNPChunksToLookupWindowAnnotations;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.RemoveEnclosedLookupWindows;
+import org.apache.ctakes.core.pipeline.PiperFileReader;
import org.apache.ctakes.typesystem.type.refsem.Event;
import org.apache.ctakes.typesystem.type.refsem.EventProperties;
import org.apache.ctakes.typesystem.type.relation.TemporalTextRelation;
@@ -30,10 +28,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.uima.UIMAException;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
-import org.apache.uima.fit.factory.AggregateBuilder;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.JCasFactory;
-import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.junit.Test;
@@ -48,38 +43,44 @@ public class EventEventRelationAnnotatorTest extends TemporalTest_ImplBase {
@Test
public void testPipeline() throws UIMAException, IOException {
-
+ if ( !canUseUmlsDictionary() ) {
+ LOGGER.warn( "Running this test requires that UmlsKey is set in your environment." );
+ return;
+ }
String note = "The patient is a 55-year-old man referred by Dr. Good for recently diagnosed colorectal cancer. "
+ "The patient was well till 6 months ago, when he started having a little blood with stool.";
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText(note);
- // Get the default pipeline with umls dictionary lookup
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(getTokenProcessingPipeline());
- builder.add(AnalysisEngineFactory
- .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
- builder.add(AnalysisEngineFactory
- .createEngineDescription(RemoveEnclosedLookupWindows.class));
- // Commented out the Dictionary lookup for the test
- // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
- // needed
- //builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
-
- // Add BackwardsTimeAnnotator
- builder.add(BackwardsTimeAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
- // Add EventAnnotator
- builder.add(EventAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
- //link event to eventMention
- builder.add(AnalysisEngineFactory.createEngineDescription(AddEvent.class));
- // Add Event to Event Relation Annotator
- builder.add(EventEventRelationAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventevent/model.jar"));
-
- SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+// // Get the default pipeline with umls dictionary lookup
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(getTokenProcessingPipeline());
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(RemoveEnclosedLookupWindows.class));
+// // Commented out the Dictionary lookup for the test
+// // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
+// // needed
+// //builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
+// builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+//
+// // Add BackwardsTimeAnnotator
+// builder.add(BackwardsTimeAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
+// // Add EventAnnotator
+// builder.add(EventAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
+// //link event to eventMention
+// builder.add(AnalysisEngineFactory.createEngineDescription(AddEvent.class));
+// // Add Event to Event Relation Annotator
+// builder.add(EventEventRelationAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventevent/model.jar"));
+//
+// SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+
+ // Use piper files so that a module doesn't need to depend upon all of ctakes just to run a test.
+ new PiperFileReader( "DefaultTemporalPipeline" ).getBuilder().run( jcas );
Collection<TemporalTextRelation> relations = JCasUtil.select(jcas,
TemporalTextRelation.class);
diff --git a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventTimeRelationAnnotatorTest.java b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventTimeRelationAnnotatorTest.java
index fc6af58..1f39013 100644
--- a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventTimeRelationAnnotatorTest.java
+++ b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/EventTimeRelationAnnotatorTest.java
@@ -19,9 +19,7 @@
package org.apache.ctakes.temporal.ae;
import com.google.common.collect.Lists;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.CopyNPChunksToLookupWindowAnnotations;
-import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.RemoveEnclosedLookupWindows;
+import org.apache.ctakes.core.pipeline.PiperFileReader;
import org.apache.ctakes.typesystem.type.refsem.Event;
import org.apache.ctakes.typesystem.type.refsem.EventProperties;
import org.apache.ctakes.typesystem.type.relation.TemporalTextRelation;
@@ -30,10 +28,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.uima.UIMAException;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
-import org.apache.uima.fit.factory.AggregateBuilder;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.JCasFactory;
-import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.junit.Test;
@@ -48,38 +43,44 @@ public class EventTimeRelationAnnotatorTest extends TemporalTest_ImplBase {
@Test
public void testPipeline() throws UIMAException, IOException {
-
+ if ( !canUseUmlsDictionary() ) {
+ LOGGER.warn( "Running this test requires that UmlsKey is set in your environment." );
+ return;
+ }
String note = "The patient is a 55-year-old man referred by Dr. Good for recently diagnosed colorectal cancer. "
+ "The patient was well till 6 months ago, when he started having a little blood with stool.";
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText(note);
- // Get the default pipeline with umls dictionary lookup
- AggregateBuilder builder = new AggregateBuilder();
- builder.add(getTokenProcessingPipeline());
- builder.add(AnalysisEngineFactory
- .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
- builder.add(AnalysisEngineFactory
- .createEngineDescription(RemoveEnclosedLookupWindows.class));
- // Commented out the Dictionary lookup for the test
- // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
- // needed
- //builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
- builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
-
- // Add BackwardsTimeAnnotator
- builder.add(BackwardsTimeAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
- // Add EventAnnotator
- builder.add(EventAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
- //link event to eventMention
- builder.add(AnalysisEngineFactory.createEngineDescription(AddEvent.class));
- // Add Event to Event Relation Annotator
- builder.add(EventTimeRelationAnnotator
- .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventtime/model.jar"));
-
- SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+// // Get the default pipeline with umls dictionary lookup
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add(getTokenProcessingPipeline());
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class));
+// builder.add(AnalysisEngineFactory
+// .createEngineDescription(RemoveEnclosedLookupWindows.class));
+// // Commented out the Dictionary lookup for the test
+// // Uncomment and set -Dctakes.umlsuser and -Dctakes.umlspw env params if
+// // needed
+// //builder.add(UmlsDictionaryLookupAnnotator.createAnnotatorDescription());
+// builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription());
+//
+// // Add BackwardsTimeAnnotator
+// builder.add(BackwardsTimeAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/timeannotator/model.jar"));
+// // Add EventAnnotator
+// builder.add(EventAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventannotator/model.jar"));
+// //link event to eventMention
+// builder.add(AnalysisEngineFactory.createEngineDescription(AddEvent.class));
+// // Add Event to Event Relation Annotator
+// builder.add(EventTimeRelationAnnotator
+// .createAnnotatorDescription("/org/apache/ctakes/temporal/models/eventtime/model.jar"));
+//
+// SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());
+
+ // Use piper files so that a module doesn't need to depend upon all of ctakes just to run a test.
+ new PiperFileReader( "DefaultTemporalPipeline" ).getBuilder().run( jcas );
Collection<TemporalTextRelation> relations = JCasUtil.select(jcas,
TemporalTextRelation.class);
diff --git a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/TemporalTest_ImplBase.java b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/TemporalTest_ImplBase.java
index a2ad7be..0b7c13a 100644
--- a/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/TemporalTest_ImplBase.java
+++ b/ctakes-temporal/src/test/java/org/apache/ctakes/temporal/ae/TemporalTest_ImplBase.java
@@ -1,26 +1,33 @@
package org.apache.ctakes.temporal.ae;
-import org.apache.ctakes.context.tokenizer.ae.ContextDependentTokenizerAnnotator;
-import org.apache.ctakes.core.ae.SentenceDetector;
-import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
-import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
-import org.apache.ctakes.postagger.POSTagger;
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
-import org.apache.uima.fit.factory.AggregateBuilder;
import org.apache.uima.resource.ResourceInitializationException;
import java.net.MalformedURLException;
public class TemporalTest_ImplBase {
public static AnalysisEngineDescription getTokenProcessingPipeline() throws ResourceInitializationException, MalformedURLException {
- AggregateBuilder builder = new AggregateBuilder();
- builder.add( SimpleSegmentAnnotator.createAnnotatorDescription() );
- builder.add( SentenceDetector.createAnnotatorDescription() );
- builder.add( TokenizerAnnotatorPTB.createAnnotatorDescription() );
-// builder.add( LvgAnnotator.createAnnotatorDescription() );
- builder.add( ContextDependentTokenizerAnnotator.createAnnotatorDescription() );
- builder.add( POSTagger.createAnnotatorDescription() );
- return builder.createAggregateDescription();
+ throw new ResourceInitializationException(
+ new Exception( "Use Piper files so that the module doesn't need to declare unnecessary dependencies." ) );
+// AggregateBuilder builder = new AggregateBuilder();
+// builder.add( SimpleSegmentAnnotator.createAnnotatorDescription() );
+// builder.add( SentenceDetector.createAnnotatorDescription() );
+// builder.add( TokenizerAnnotatorPTB.createAnnotatorDescription() );
+//// builder.add( LvgAnnotator.createAnnotatorDescription() );
+// builder.add( ContextDependentTokenizerAnnotator.createAnnotatorDescription() );
+// builder.add( POSTagger.createAnnotatorDescription() );
+// return builder.createAggregateDescription();
+ }
+
+ /**
+ *
+ * @return true if the user has set their umls api key in the environment.
+ */
+ protected boolean canUseUmlsDictionary() {
+ return System.getProperty( "UmlsKey" ) != null
+ || System.getProperty( "umls_api_key" ) != null
+ || System.getProperty( "ctakes.umls_apikey" ) != null;
+
}
}
diff --git a/ctakes-utils/pom.xml b/ctakes-utils/pom.xml
index 7934c44..ca08ea6 100644
--- a/ctakes-utils/pom.xml
+++ b/ctakes-utils/pom.xml
@@ -31,8 +31,8 @@
</parent>
<dependencies>
<dependency>
- <groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-type-system</artifactId>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>uimaj-core</artifactId>
</dependency>
<dependency>
<groupId>tw.edu.ntu.csie</groupId>
@@ -44,21 +44,21 @@
<!-- TODO: refactor TestUtil.java and remove dependency over scope:compile -->
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-queries</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.lucene</groupId>-->
+<!-- <artifactId>lucene-core</artifactId>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>org.apache.lucene</groupId>-->
+<!-- <artifactId>lucene-queries</artifactId>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-analyzers-common</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.apache.lucene</groupId>-->
+<!-- <artifactId>lucene-analyzers-common</artifactId>-->
+<!-- </dependency>-->
</dependencies>
</project>
diff --git a/pom.xml b/pom.xml
index bd663ef..edc255c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -121,6 +121,7 @@
<gson.version>2.8.9</gson.version>
<guava.version>33.2.1-jre</guava.version>
<hapi.fhir.version>6.6.0</hapi.fhir.version>
+ <hapi.fhir.dstu3.version>6.3.18</hapi.fhir.dstu3.version>
<hibernate.version>5.4.24.Final</hibernate.version>
<hsqldb.version>2.7.3</hsqldb.version>
<httpclient.version>5.3.1</httpclient.version>
@@ -314,11 +315,17 @@
<artifactId>classgraph</artifactId>
<version>${classgraph.version}</version>
</dependency>
+ <!-- hapi-fhir-structures-dstu3 is required to actually write a dstu3 json file -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu3</artifactId>
<version>${hapi.fhir.version}</version>
</dependency>
+ <dependency>
+ <groupId>ca.uhn.hapi.fhir</groupId>
+ <artifactId>org.hl7.fhir.dstu3</artifactId>
+ <version>${hapi.fhir.dstu3.version}</version>
+ </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
@@ -955,7 +962,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-core-model</artifactId>
+ <artifactId>ctakes-core-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -980,7 +987,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-pos-tagger-model</artifactId>
+ <artifactId>ctakes-pos-tagger-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -990,7 +997,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-chunker-model</artifactId>
+ <artifactId>ctakes-chunker-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1025,7 +1032,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-assertion-model</artifactId>
+ <artifactId>ctakes-assertion-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1040,7 +1047,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-constituency-parser-model</artifactId>
+ <artifactId>ctakes-constituency-parser-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1050,7 +1057,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-coreference-model</artifactId>
+ <artifactId>ctakes-coreference-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1065,7 +1072,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-side-effect-model</artifactId>
+ <artifactId>ctakes-side-effect-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1075,7 +1082,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-smoking-status-model</artifactId>
+ <artifactId>ctakes-smoking-status-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1085,12 +1092,12 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-dependency-parser-model</artifactId>
+ <artifactId>ctakes-dependency-parser-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-dependency-parser-model-clear</artifactId>
+ <artifactId>ctakes-dependency-parser-models-clear</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1100,7 +1107,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-relation-extractor-model</artifactId>
+ <artifactId>ctakes-relation-extractor-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1110,7 +1117,7 @@
</dependency>
<dependency>
<groupId>org.apache.ctakes</groupId>
- <artifactId>ctakes-temporal-model</artifactId>
+ <artifactId>ctakes-temporal-models</artifactId>
<version>${ctakes-models.version}</version>
</dependency>
<dependency>
@@ -1391,6 +1398,31 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze</goal>
+ </goals>
+ <phase>test-compile</phase>
+ <configuration>
+ <ignoredUnusedDeclaredDependencies>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-core-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-pos-tagger-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-chunker-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-constituency-parser-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-smoking-status-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-side-effect-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-dependency-parser-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-dependency-parser-models-clear</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-assertion-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-relation-extractor-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-temporal-models</ignoredUnusedDeclaredDependency>
+ <ignoredUnusedDeclaredDependency>org.apache.ctakes:ctakes-coreference-models</ignoredUnusedDeclaredDependency>
+ </ignoredUnusedDeclaredDependencies>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>