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 2022/12/20 00:36:07 UTC
[ctakes] branch main updated: Some touch ups on the examples Added [set] creator to IdentifiedAnnotationBuilder for non-umls group IA
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 99acba0 Some touch ups on the examples Added [set] creator to IdentifiedAnnotationBuilder for non-umls group IA
99acba0 is described below
commit 99acba0fa7b04e047d42262a013d762ddf815222
Author: Sean Finan <se...@childrens.harvard.edu>
AuthorDate: Mon Dec 19 19:35:55 2022 -0500
Some touch ups on the examples
Added [set] creator to IdentifiedAnnotationBuilder for non-umls group IA
---
.../annotation/IdentifiedAnnotationBuilder.java | 21 ++++++++-
.../apache/ctakes/examples/ae/BodySideFinder.java | 54 +++++++++++++---------
...dAnnotator.java => ConfigParameterExample.java} | 28 +++++------
.../apache/ctakes/examples/ae/RegexBpFinder.java | 6 ++-
.../pipeline/HelloWorldAggregatePipeline.java | 4 +-
.../examples/pipeline/HelloWorldBuilderRunner.java | 4 +-
.../examples/pipeline/HelloWorldPiperRunner.java | 52 ---------------------
.../examples/pipeline/MultiThreadedPipeline.java | 2 +-
.../examples/pipeline/ProcessDirBuilderRunner.java | 2 +-
.../pipeline/ProcessLinesClinicalRunner.java | 6 +--
.../ctakes/examples/pipeline/BigPipeline.piper | 23 ++++-----
11 files changed, 88 insertions(+), 114 deletions(-)
diff --git a/ctakes-core/src/main/java/org/apache/ctakes/core/util/annotation/IdentifiedAnnotationBuilder.java b/ctakes-core/src/main/java/org/apache/ctakes/core/util/annotation/IdentifiedAnnotationBuilder.java
index 26bc27b..a7e76b7 100644
--- a/ctakes-core/src/main/java/org/apache/ctakes/core/util/annotation/IdentifiedAnnotationBuilder.java
+++ b/ctakes-core/src/main/java/org/apache/ctakes/core/util/annotation/IdentifiedAnnotationBuilder.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Objects;
+import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -27,6 +28,7 @@ final public class IdentifiedAnnotationBuilder {
static private final Pair<Integer> NULL_SPAN = new Pair<>( -1, -1 );
private Pair<Integer> _textSpan = NULL_SPAN;
+ private Function<JCas, ? extends IdentifiedAnnotation> _creator;
private SemanticGroup _group = SemanticGroup.UNKNOWN;
private SemanticTui _type = SemanticTui.UNKNOWN;
private final Collection<OntologyConcept> _concepts = new HashSet<>();
@@ -60,6 +62,16 @@ final public class IdentifiedAnnotationBuilder {
return this;
}
+ /**
+ * Allow for creation of IdentifiedAnnotations outside those created/determined by Semantic Group
+ * @param creator some IdentifiedAnnotation creation function, e.g.TimeAnnotation::new
+ * @return this builder
+ */
+ public IdentifiedAnnotationBuilder creator( final Function<JCas, ? extends IdentifiedAnnotation> creator ) {
+ _creator = creator;
+ return this;
+ }
+
/**
* @param semanticGroup for the annotation
* @return this builder
@@ -194,6 +206,13 @@ final public class IdentifiedAnnotationBuilder {
return _group;
}
+ public Function<JCas, ? extends IdentifiedAnnotation> getCreator( final SemanticGroup group ) {
+ if ( _creator != null ) {
+ return _creator;
+ }
+ return group.getCreator();
+ }
+
private void addConcepts( final JCas jCas, final IdentifiedAnnotation annotation ) {
if ( !_concepts.isEmpty() ) {
final FSArray conceptArr = new FSArray( jCas, _concepts.size() );
@@ -294,7 +313,7 @@ final public class IdentifiedAnnotationBuilder {
return null;
}
final SemanticGroup group = getGroup();
- final IdentifiedAnnotation annotation = group.getCreator()
+ final IdentifiedAnnotation annotation = getCreator( group )
.apply( jcas );
annotation.setTypeID( group.getCode() );
annotation.setBegin( _textSpan.getValue1() );
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/BodySideFinder.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/BodySideFinder.java
index 4e6a112..a134862 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/BodySideFinder.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/BodySideFinder.java
@@ -3,8 +3,11 @@ package org.apache.ctakes.examples.ae;
import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
import org.apache.ctakes.core.pipeline.PipeBitInfo;
import org.apache.ctakes.core.pipeline.PipelineBuilder;
+import org.apache.ctakes.core.util.annotation.ConceptBuilder;
+import org.apache.ctakes.core.util.annotation.IdentifiedAnnotationBuilder;
+import org.apache.ctakes.core.util.annotation.SemanticGroup;
+import org.apache.ctakes.core.util.annotation.SemanticTui;
import org.apache.ctakes.core.util.doc.TextBySentenceBuilder;
-import org.apache.ctakes.typesystem.type.refsem.UmlsConcept;
import org.apache.ctakes.typesystem.type.syntax.WordToken;
import org.apache.ctakes.typesystem.type.textsem.AnatomicalSiteMention;
import org.apache.ctakes.typesystem.type.textsem.BodySideModifier;
@@ -17,7 +20,6 @@ import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.cas.FSArray;
import org.apache.uima.jcas.tcas.Annotation;
import java.io.IOException;
@@ -61,34 +63,37 @@ final public class BodySideFinder extends JCasAnnotator_ImplBase {
private enum Side {
RIGHT( "C0205090", "right", "dextro" ),
LEFT( "C0205091", "left", "levo" );
- final private String _cui;
final private Collection<String> _patterns;
+ // Set up a builder for body side modifiers.
+ final private IdentifiedAnnotationBuilder _sideBuilder
+ = new IdentifiedAnnotationBuilder().creator( BodySideModifier::new );
+ // Set up a builder for conceptual entities.
+ final private ConceptBuilder _cuiBuilder
+ = new ConceptBuilder().type( SemanticTui.T077 );
Side( final String cui, final String... patterns ) {
- _cui = cui;
+ // Assign cui and preferred text to the concept builder for this side.
+ _cuiBuilder.cui( cui ).preferredText( patterns[ 0 ] );
_patterns = Arrays.asList( patterns );
}
boolean isMatch( final WordToken word ) {
+ // The word token covers text in the document that matches one of the patterns, case-insensitive.
return _patterns.stream()
.anyMatch( word.getCoveredText()::equalsIgnoreCase );
}
BodySideModifier createModifier( final JCas jCas, final WordToken word ) {
- final BodySideModifier side = new BodySideModifier( jCas, word.getBegin(), word.getEnd() );
- final UmlsConcept umlsConcept = new UmlsConcept( jCas );
- umlsConcept.setCui( _cui );
- final FSArray conceptArr = new FSArray( jCas, 1 );
- conceptArr.set( 0, umlsConcept );
- side.setOntologyConceptArr( conceptArr );
- side.addToIndexes( jCas );
- return side;
+ // Set the span to match the word, set the concept (built with our concept builder), build the side modifier.
+ return (BodySideModifier) _sideBuilder.span( word.getBegin(), word.getEnd() )
+ .concept( _cuiBuilder.build( jCas ) )
+ .build( jCas );
}
}
/**
* Process Sentence -by- Sentence.
- * If a sentence has anatomic site(s) and wordtokens that match a body side synonym,
+ * If a sentence has anatomic site(s) and WordToken that match a body side synonym,
* BodySideModifier(s) are created and attached to anatomic sites that follow in the sentence.
* {@inheritDoc}
*/
@@ -102,7 +107,8 @@ final public class BodySideFinder extends JCasAnnotator_ImplBase {
final Map<Sentence, Collection<WordToken>> sentenceWordMap
= JCasUtil.indexCovered( jCas, Sentence.class, WordToken.class );
- sentenceSiteMap.entrySet().stream()
+ sentenceSiteMap.entrySet()
+ .stream()
.filter( e -> !e.getValue().isEmpty() )
.forEach( e -> assignSides( jCas, e.getValue(), sentenceWordMap.get( e.getKey() ) ) );
@@ -152,17 +158,21 @@ final public class BodySideFinder extends JCasAnnotator_ImplBase {
final String sentence = "He had a slight fracture in the proximal right fibula";
final int index = sentence.indexOf( "fibula" );
try {
- final AnalysisEngineDescription analysisEngine = new PipelineBuilder()
- .add( TokenizerAnnotatorPTB.class )
- .add( BodySideFinder.class )
- .getAnalysisEngineDesc();
+ // TextBySentenceBuilder builds a jCas from appended sentences.
+ // This does more than just setting the document text.
final JCas jCas = new TextBySentenceBuilder()
.addSentence( sentence )
.build();
- final AnatomicalSiteMention site = new AnatomicalSiteMention( jCas, index, index + 6 );
- site.addToIndexes( jCas );
-
- SimplePipeline.runPipeline( jCas, analysisEngine );
+ // IdentifiedAnnotationBuilder creates an identified annotation and adds it to the cas.
+ final AnatomicalSiteMention site
+ = (AnatomicalSiteMention) new IdentifiedAnnotationBuilder().group( SemanticGroup.ANATOMY )
+ .span( index, index + 6 )
+ .build( jCas );
+ // PipelineBuilder creates and can run pipelines.
+ new PipelineBuilder()
+ .add( TokenizerAnnotatorPTB.class )
+ .add( BodySideFinder.class )
+ .run( jCas );
LOGGER.info( site.getCoveredText() + " has body side " + site.getBodySide().getCoveredText() );
} catch ( IOException | UIMAException uE ) {
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ExampleHelloWorldAnnotator.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ConfigParameterExample.java
similarity index 81%
rename from ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ExampleHelloWorldAnnotator.java
rename to ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ConfigParameterExample.java
index 17bfccf..28d8396 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ExampleHelloWorldAnnotator.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ConfigParameterExample.java
@@ -23,7 +23,6 @@ import java.util.Collection;
import org.apache.ctakes.typesystem.type.syntax.BaseToken;
import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
import org.apache.log4j.Logger;
-import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.jcas.JCas;
@@ -33,16 +32,19 @@ import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.util.JCasUtil;
-public class ExampleHelloWorldAnnotator extends JCasAnnotator_ImplBase {
+
+public class ConfigParameterExample extends JCasAnnotator_ImplBase {
public static final String PARAM_SAVE_ANN = "PARAM_SAVE_ANN";
public static final String PARAM_PRINT_ANN = "PARAM_PRINT_ANN";
private Logger LOG = Logger.getLogger(getClass().getName());
- @ConfigurationParameter(name = PARAM_SAVE_ANN, mandatory = false, description = "Example of Options/Parameters Save Annotation?")
+ @ConfigurationParameter(name = PARAM_SAVE_ANN, mandatory = false,
+ description = "Example of Options/Parameters Save Annotation?")
protected boolean saveAnnotation = true;
- @ConfigurationParameter(name = PARAM_PRINT_ANN, mandatory = false, description = "Example of Options/Parameters Print Annotation?")
+ @ConfigurationParameter(name = PARAM_PRINT_ANN, mandatory = false,
+ description = "Example of Options/Parameters Print Annotation?")
protected boolean printAnnotation = true;
@Override
@@ -66,26 +68,20 @@ public class ExampleHelloWorldAnnotator extends JCasAnnotator_ImplBase {
}
}
- @Override
- public void initialize(UimaContext context)
- throws ResourceInitializationException {
- super.initialize(context);
- }
-
public static AnalysisEngineDescription createAnnotatorDescription(
boolean saveAnn, boolean printAnn)
throws ResourceInitializationException {
return AnalysisEngineFactory.createEngineDescription(
- ExampleHelloWorldAnnotator.class,
- ExampleHelloWorldAnnotator.PARAM_SAVE_ANN, saveAnn,
- ExampleHelloWorldAnnotator.PARAM_PRINT_ANN, printAnn);
+ ConfigParameterExample.class,
+ ConfigParameterExample.PARAM_SAVE_ANN, saveAnn,
+ ConfigParameterExample.PARAM_PRINT_ANN, printAnn );
}
public static AnalysisEngineDescription createAnnotatorDescription()
throws ResourceInitializationException {
return AnalysisEngineFactory.createEngineDescription(
- ExampleHelloWorldAnnotator.class,
- ExampleHelloWorldAnnotator.PARAM_SAVE_ANN, true,
- ExampleHelloWorldAnnotator.PARAM_PRINT_ANN, true);
+ ConfigParameterExample.class,
+ ConfigParameterExample.PARAM_SAVE_ANN, true,
+ ConfigParameterExample.PARAM_PRINT_ANN, true );
}
}
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/RegexBpFinder.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/RegexBpFinder.java
index b9e5b41..5110de2 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/RegexBpFinder.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/RegexBpFinder.java
@@ -29,7 +29,8 @@ final public class RegexBpFinder extends JCasAnnotator_ImplBase {
static private final Logger LOGGER = Logger.getLogger( "RegexBpFinder" );
- static private final Collection<String> BP_SECTIONS = Arrays.asList( "Vital Signs", "General Exam", "Objective", "SIMPLE_SEGMENT" );
+ static private final Collection<String> BP_SECTIONS
+ = Arrays.asList( "Vital Signs", "General Exam", "Objective", "SIMPLE_SEGMENT" );
static private final String BP_TRIGGER = "\\bB\\/?P(?:\\s*:)?\\s+";
static private final String VIT_BP_TRIGGER = "^VITS?:\\s+";
@@ -61,7 +62,8 @@ final public class RegexBpFinder extends JCasAnnotator_ImplBase {
return;
}
Collection<Pair<Integer>> spans = new ArrayList<>();
- try ( RegexSpanFinder finder = new RegexSpanFinder( VIT_BP_TRIGGER, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE, 1000 ) ) {
+ try ( RegexSpanFinder finder
+ = new RegexSpanFinder( VIT_BP_TRIGGER, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE, 1000 ) ) {
spans.addAll( finder.findSpans( sectionText ) );
} catch ( IllegalArgumentException iaE ) {
LOGGER.error( iaE.getMessage() );
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldAggregatePipeline.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldAggregatePipeline.java
index e45fe95..c950f51 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldAggregatePipeline.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldAggregatePipeline.java
@@ -1,7 +1,7 @@
package org.apache.ctakes.examples.pipeline;
import org.apache.ctakes.clinicalpipeline.ClinicalPipelineFactory;
-import org.apache.ctakes.examples.ae.ExampleHelloWorldAnnotator;
+import org.apache.ctakes.examples.ae.ConfigParameterExample;
import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
import org.apache.uima.fit.factory.AggregateBuilder;
import org.apache.uima.fit.factory.JCasFactory;
@@ -36,7 +36,7 @@ public class HelloWorldAggregatePipeline {
builder.add( ClinicalPipelineFactory.getTokenProcessingPipeline() );
//Add the new HelloWorld Example:
- builder.add( ExampleHelloWorldAnnotator.createAnnotatorDescription() );
+ builder.add( ConfigParameterExample.createAnnotatorDescription() );
//Run the Aggregate Pipeline
SimplePipeline.runPipeline( jcas, builder.createAggregateDescription() );
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldBuilderRunner.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldBuilderRunner.java
index 91117bb..8de23e8 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldBuilderRunner.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldBuilderRunner.java
@@ -6,7 +6,7 @@ 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.pipeline.PipelineBuilder;
-import org.apache.ctakes.examples.ae.ExampleHelloWorldAnnotator;
+import org.apache.ctakes.examples.ae.ConfigParameterExample;
import org.apache.ctakes.postagger.POSTagger;
import org.apache.log4j.Logger;
import org.apache.uima.UIMAException;
@@ -48,7 +48,7 @@ final public class HelloWorldBuilderRunner {
// The POSTagger has a -complex- startup, but it can create its own description to handle it
.addDescription( POSTagger.createAnnotatorDescription() )
// add the simple Hello World Annotator
- .add( ExampleHelloWorldAnnotator.class );
+ .add( ConfigParameterExample.class );
if ( args.length > 0 ) {
// Example to save the Aggregate descriptor to an xml file for external use such as the UIMA CVD
builder.writeXMIs( args[ 0 ] );
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldPiperRunner.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldPiperRunner.java
deleted file mode 100644
index acff41d..0000000
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/HelloWorldPiperRunner.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.apache.ctakes.examples.pipeline;
-
-
-import org.apache.ctakes.core.pipeline.PipelineBuilder;
-import org.apache.ctakes.core.pipeline.PiperFileReader;
-import org.apache.log4j.Logger;
-import org.apache.uima.UIMAException;
-
-import java.io.IOException;
-
-/**
- * Build and run a pipeline using a {@link PiperFileReader} and a {@link PipelineBuilder}.
- * <p>
- * Example of a running a pipeline programatically w/o uima xml descriptor xml files
- * Adds the default Tokenization pipeline and adding the Example HelloWorld Annotator
- *
- * @author SPF , chip-nlp
- * @version %I%
- * @since 10/10/2016
- */
-final public class HelloWorldPiperRunner {
-
- static private final Logger LOGGER = Logger.getLogger( "HelloWorldPiperRunner" );
-
- static private final String PIPER_FILE_PATH = "org/apache/ctakes/examples/pipeline/HelloWorld.piper";
-
- static private final String DOC_TEXT = "Hello World!";
-
- private HelloWorldPiperRunner() {
- }
-
- /**
- * @param args an output directory for xmi files or none if xmi files are not wanted
- */
- public static void main( final String... args ) {
- try {
- // Add a simple pre-defined existing pipeline for Tokenization from file
- final PiperFileReader reader = new PiperFileReader( PIPER_FILE_PATH );
- PipelineBuilder builder = reader.getBuilder();
- if ( args.length > 0 ) {
- // Example to save the Aggregate descriptor to an xml file for external use such as the UIMA CVD
- builder.writeXMIs( args[ 0 ] );
- }
- // Run the pipeline with specified text
- builder.run( DOC_TEXT );
- } catch ( IOException | UIMAException multE ) {
- LOGGER.error( multE.getMessage() );
- }
- }
-
-
-}
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/MultiThreadedPipeline.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/MultiThreadedPipeline.java
index e22ab05..43c8a60 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/MultiThreadedPipeline.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/MultiThreadedPipeline.java
@@ -57,7 +57,7 @@ public class MultiThreadedPipeline {
// FilesInDirectoryCollectionReader.class,
FileTreeReader.class,
ConfigParameterConstants.PARAM_INPUTDIR,
- "src/user/resources/org/apache/ctakes/examples/annotation/anafora_annotated/" );
+ "org/apache/ctakes/examples/annotation/anafora_annotated/" );
// FilesInDirectoryCollectionReader.PARAM_RECURSE,
// true);
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessDirBuilderRunner.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessDirBuilderRunner.java
index f438e99..eef1b44 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessDirBuilderRunner.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessDirBuilderRunner.java
@@ -23,7 +23,7 @@ final public class ProcessDirBuilderRunner {
static private final Logger LOGGER = Logger.getLogger( "ProcessDirBuilderRunner" );
- static private final String INPUT_DIR = "src/user/resources/org/apache/ctakes/examples/notes";
+ static private final String INPUT_DIR = "org/apache/ctakes/examples/notes/annotated";
private ProcessDirBuilderRunner() {
}
diff --git a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessLinesClinicalRunner.java b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessLinesClinicalRunner.java
index 972cc5f..b10fe77 100644
--- a/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessLinesClinicalRunner.java
+++ b/ctakes-examples/src/main/java/org/apache/ctakes/examples/pipeline/ProcessLinesClinicalRunner.java
@@ -26,11 +26,9 @@ final public class ProcessLinesClinicalRunner {
static private final Logger LOGGER = Logger.getLogger( "ProcessLinesClinicalRunner" );
- static private final String PIPER_FILE_PATH = "src/user/resources/org/apache/ctakes/clinical/pipeline"
- + "/DefaultFastPipeline.piper";
+ static private final String PIPER_FILE_PATH = "org/apache/ctakes/clinical/pipeline/DefaultFastPipeline.piper";
- static private final String INPUT_FILE_PATH = "src/user/resources/org/apache/ctakes/examples/notes"
- + "/right_knee_arthroscopy";
+ static private final String INPUT_FILE_PATH = "org/apache/ctakes/examples/notes/right_knee_arthroscopy";
private ProcessLinesClinicalRunner() {
}
diff --git a/ctakes-examples/src/user/resources/org/apache/ctakes/examples/pipeline/BigPipeline.piper b/ctakes-examples/src/user/resources/org/apache/ctakes/examples/pipeline/BigPipeline.piper
index 856cd14..4abd961 100644
--- a/ctakes-examples/src/user/resources/org/apache/ctakes/examples/pipeline/BigPipeline.piper
+++ b/ctakes-examples/src/user/resources/org/apache/ctakes/examples/pipeline/BigPipeline.piper
@@ -5,43 +5,44 @@
//
/////////////////////////////////////////////////////////
+// Write big "Welcome", "Starting", "Finished" Banners in log.
set WriteBanner=yes
-// Advanced Tokenization: Regex sectionization, BIO Sentence Detector (lumper), Paragraphs, Lists
+// Advanced Tokenization: Regex sectionization, BIO Sentence Detector (lumper), Paragraphs, Lists.
load FullTokenizerPipeline
// OR use the standard tokenizer pipeline:
//load DefaultTokenizerPipeline
-// Refined tokens, Parts of Speech
+// Refined tokens, Parts of Speech.
add ContextDependentTokenizerAnnotator
add POSTagger
// Chunkers
load ChunkerSubPipe
-// Default fast dictionary lookup
+// Default fast dictionary lookup.
set minimumSpan=2
load DictionarySubPipe
-// Cleartk Entity Attributes (negation, uncertainty, etc.)
+// Cleartk Entity Attributes (negation, uncertainty, etc.).
load AttributeCleartkSubPipe
-// Entity Relations (degree/severity, anatomical location)
+// Entity Relations (degree/severity, anatomical location).
load RelationSubPipe
-// Temporal (event, time, dtr, tlink)
+// Temporal (event, time, dtr, tlink).
load TemporalSubPipe
-// Coreferences (e.g. patient = he)
+// Coreferences (e.g. patient = he).
load CorefSubPipe
-// Html output, write to subdirectory
+// Html output, write to subdirectory.
add pretty.html.HtmlTextWriter SubDirectory=html
-// Text output, write to subdirectory
+// Text output, write to subdirectory.
add pretty.plaintext.PrettyTextWriterFit SubDirectory=text
-// Table output, write to subdirectory
+// Table output, write to subdirectory. Write bsv (default) and html styles.
add SemanticTableFileWriter SubDirectory=bsv_table
add SemanticTableFileWriter SubDirectory=html_table TableType=HTML
@@ -49,5 +50,5 @@ add SemanticTableFileWriter SubDirectory=html_table TableType=HTML
//writeXmis
add FileTreeXmiWriter SubDirectory=xmi
-// Write some information about the run
+// Write some information about the run.
addLast org.apache.ctakes.core.util.log.FinishedLogger
\ No newline at end of file