1

我已经签出 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 类)。如果是,怎么可能?

4

0 回答 0