I have checked-out ctakes-4.0.0 (https://codeload.github.com/apache/ctakes/zip/ctakes-4.0.0) and setup in my local machine. I have setup the pipeline for a particular requirement as below
load DefaultTokenizerPipeline.piper
add ContextDependentTokenizerAnnotator
addDescription POSTagger
load ChunkerSubPipe.piper
add DefaultJCasTermAnnotator
load AttributeCleartkSubPipe.piper
# Parameters for AssertionAnalysisEngine and ConceptConverterAnalysisEngine
set assertionModelResource=file: org/apache/ctakes/assertion/models/i2b2.model
set scopeModelResource=file: org/apache/ctakes/assertion/models/scope.model
set cueModelResource=file: org/apache/ctakes/assertion/models/cue.model
set enabledFeaturesResource=file: org/apache/ctakes/assertion/models/featureFile11b
set posModelResource=file: org/apache/ctakes/assertion/models/pos.model
package org.apache.ctakes.assertion.medfacts
package org.apache.ctakes.assertion.attributes
add ConceptConverterAnalysisEngine
add GenericAttributeAnalysisEngine
add SubjectAttributeAnalysisEngine
ContextHitConsumerClass=org.apache.ctakes.necontexts.status.StatusContextHitConsumer MaxLeftScopeSize=10 MaxRightScopeSize=10
add org.apache.ctakes.drugner.ae.DrugMentionAnnotator STATUS_BOUNDARY_ANN_TYPE="org.apache.ctakes.typesystem.type.textsem.MedicationMention"
add org.apache.ctakes.constituency.parser.ae.ConstituencyParser
addLogged ModifierExtractorAnnotator classifierJarPath=/org/apache/ctakes/relationextractor/models/modifier_extractor/model.jar
addLogged DegreeOfRelationExtractorAnnotator classifierJarPath=/org/apache/ctakes/relationextractor/models/degree_of/model.jar
addLogged LocationOfRelationExtractorAnnotator classifierJarPath=/org/apache/ctakes/relationextractor/models/location_of/model.jar
addDescription EventAnnotator
add BackwardsTimeAnnotator classifierJarPath=/org/apache/ctakes/temporal/ae/timeannotator/model.jar
add EventTimeRelationAnnotator classifierJarPath=/org/apache/ctakes/temporal/ae/eventtime/model.jar
add EventEventRelationAnnotator classifierJarPath=/org/apache/ctakes/temporal/ae/eventevent/model.jar
add org.apache.ctakes.core.cc.pretty.html.HtmlTextWriter OutputDirectory="C:\ctakes\ctakes-output"
I am able to run it using example module main() method. It writes the output as an html format.
The main() method which I am running is as below.
PiperFileReader reader;
try {
reader = new PiperFileReader( PIPER_FILE_PATH );
PipelineBuilder builder = reader.getBuilder();
String content = readLineByLineJava8("C:\\ctakes\\ctakes-input\\something.txt");
builder.run(content);
} catch (UIMAException e) {
e.printStackTrace();
}
Is it possible to create my own writer class in ctakes? (instead of using the default HtmlTextWriter class). If yes, how is it possible?