Я выписал ctakes-4.0.0 (https://codeload.github.com/apache/ctakes/zip/ctakes-4.0.0) и настроил на моей локальной машине. Я настроил конвейер для определенного требования, как показано ниже:
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"
Я могу запустить его, используя пример метода main (). Он записывает вывод в формате html.
Метод main (), который я запускаю, описан ниже.
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();
}
Возможно ли создать мой собственный писатель класс в ctakes? (вместо того, чтобы использовать класс HtmlTextWriter по умолчанию). Если да, то как это возможно?