You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ctakes.apache.org by Zuo Yiming <yi...@gmail.com> on 2017/03/15 16:29:51 UTC

How to replace SubjectCleartkAnalysisEngine with SubjectAttributeAnalysisEngine in ClinicalPipelineFactory.java

Hi everyone,

Earlier I shared my experience with the community about which analysis
engines used together can work better to identify negation, history,
uncertainty, subject, etc. ClearTk didn't work for me to detect subject,
generic and conditional status, while SubjectAttribute and GenericAttribute
worked fine.

I'm now trying to modify ClinicalPipelineFactory.java to
replace SubjectCleartkAnalysisEngine and GenericCleartkAnalysisEngine with
SubjectAttributeAnalysisEngine and GenericAttributeAnalysisEngine in
getFastPipeline method. However, it seems SubjectAttributeAnalysisEngine
and GenericAttributeAnalysisEngine doesn't have the
createAnnotatorDescription methods, which I hope I can put into
builder.add(). Can anyone guide me how to move on? Or maybe there're
additional parameters to provide to ClearTk in order to make it work
properly to detect subject, generic and conditional status?

Below are the getFastPipeline method in ClinicalPipelineFactory.java where
I believe the change should be made:

public static AnalysisEngineDescription getFastPipeline() throws
ResourceInitializationException, MalformedURLException {
      AggregateBuilder builder = new AggregateBuilder();
      builder.add( getTokenProcessingPipeline() );
      builder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
      builder.add( ClearNLPDependencyParserAE.createAnnotatorDescription()
);
      builder.add(
PolarityCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
HistoryCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
ConditionalCleartkAnalysisEngine.createAnnotatorDescription() );

-----------------------------------------------------------------------------------------------------
      builder.add(
GenericCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
SubjectCleartkAnalysisEngine.createAnnotatorDescription() );

---------------------------------------------------------------------------------------------------
      return builder.createAggregateDescription();
   }

Thanks,
Yiming

RE: How to replace SubjectCleartkAnalysisEngine with SubjectAttributeAnalysisEngine in ClinicalPipelineFactory.java

Posted by "Finan, Sean" <Se...@childrens.harvard.edu>.
Hi Yiming,

You can try using the lines:

Builder.add( 
   AnalysisEngineFactory.createEngineDescription( 
      SubjectAttributeAnalysisEngine.class ) );

Builder.add( 
   AnalysisEngineFactory.createEngineDescription( 
      GenericAttributeAnalysisEngine.class ) );

Sean

-----Original Message-----
From: Zuo Yiming [mailto:yimingzuo@gmail.com] 
Sent: Wednesday, March 15, 2017 12:30 PM
To: dev@ctakes.apache.org
Subject: How to replace SubjectCleartkAnalysisEngine with SubjectAttributeAnalysisEngine in ClinicalPipelineFactory.java

Hi everyone,

Earlier I shared my experience with the community about which analysis engines used together can work better to identify negation, history, uncertainty, subject, etc. ClearTk didn't work for me to detect subject, generic and conditional status, while SubjectAttribute and GenericAttribute worked fine.

I'm now trying to modify ClinicalPipelineFactory.java to replace SubjectCleartkAnalysisEngine and GenericCleartkAnalysisEngine with SubjectAttributeAnalysisEngine and GenericAttributeAnalysisEngine in getFastPipeline method. However, it seems SubjectAttributeAnalysisEngine and GenericAttributeAnalysisEngine doesn't have the createAnnotatorDescription methods, which I hope I can put into builder.add(). Can anyone guide me how to move on? Or maybe there're additional parameters to provide to ClearTk in order to make it work properly to detect subject, generic and conditional status?

Below are the getFastPipeline method in ClinicalPipelineFactory.java where I believe the change should be made:

public static AnalysisEngineDescription getFastPipeline() throws ResourceInitializationException, MalformedURLException {
      AggregateBuilder builder = new AggregateBuilder();
      builder.add( getTokenProcessingPipeline() );
      builder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
      builder.add( ClearNLPDependencyParserAE.createAnnotatorDescription()
);
      builder.add(
PolarityCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
HistoryCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
ConditionalCleartkAnalysisEngine.createAnnotatorDescription() );

-----------------------------------------------------------------------------------------------------
      builder.add(
GenericCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
SubjectCleartkAnalysisEngine.createAnnotatorDescription() );

---------------------------------------------------------------------------------------------------
      return builder.createAggregateDescription();
   }

Thanks,
Yiming

RE: How to replace SubjectCleartkAnalysisEngine with SubjectAttributeAnalysisEngine in ClinicalPipelineFactory.java

Posted by "Mullane, Sean *HS" <SP...@hscmail.mcc.virginia.edu>.
Hi Yiming,

Did you ever succeed in getting a "conditional" attribute annotator to work? I need the same thing, and like you it seems that ClearTK isn't doing anything for me for the conditional attribute.

Thanks,
Sean

-----Original Message-----
From: Zuo Yiming [mailto:yimingzuo@gmail.com] 
Sent: Wednesday, March 15, 2017 12:30 PM
To: dev@ctakes.apache.org
Subject: How to replace SubjectCleartkAnalysisEngine with SubjectAttributeAnalysisEngine in ClinicalPipelineFactory.java

Hi everyone,

Earlier I shared my experience with the community about which analysis engines used together can work better to identify negation, history, uncertainty, subject, etc. ClearTk didn't work for me to detect subject, generic and conditional status, while SubjectAttribute and GenericAttribute worked fine.

I'm now trying to modify ClinicalPipelineFactory.java to replace SubjectCleartkAnalysisEngine and GenericCleartkAnalysisEngine with SubjectAttributeAnalysisEngine and GenericAttributeAnalysisEngine in getFastPipeline method. However, it seems SubjectAttributeAnalysisEngine and GenericAttributeAnalysisEngine doesn't have the createAnnotatorDescription methods, which I hope I can put into builder.add(). Can anyone guide me how to move on? Or maybe there're additional parameters to provide to ClearTk in order to make it work properly to detect subject, generic and conditional status?

Below are the getFastPipeline method in ClinicalPipelineFactory.java where I believe the change should be made:

public static AnalysisEngineDescription getFastPipeline() throws ResourceInitializationException, MalformedURLException {
      AggregateBuilder builder = new AggregateBuilder();
      builder.add( getTokenProcessingPipeline() );
      builder.add( DefaultJCasTermAnnotator.createAnnotatorDescription() );
      builder.add( ClearNLPDependencyParserAE.createAnnotatorDescription()
);
      builder.add(
PolarityCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
UncertaintyCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
HistoryCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
ConditionalCleartkAnalysisEngine.createAnnotatorDescription() );

-----------------------------------------------------------------------------------------------------
      builder.add(
GenericCleartkAnalysisEngine.createAnnotatorDescription() );
      builder.add(
SubjectCleartkAnalysisEngine.createAnnotatorDescription() );

---------------------------------------------------------------------------------------------------
      return builder.createAggregateDescription();
   }

Thanks,
Yiming